public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: greg@kroah.com, linux-kernel@vger.kernel.org
Subject: [PATCH 05/15] gma500: remove the legacy PM method
Date: Fri, 15 Jul 2011 17:33:26 +0100	[thread overview]
Message-ID: <20110715163319.28759.14659.stgit@localhost.localdomain> (raw)
In-Reply-To: <20110715163117.28759.14946.stgit@localhost.localdomain>

From: Octavian Purdila <octavian.purdila@intel.com>

PCI core only prefer one of legacy PM and new PM. And since runtime pm
is implemented, which requires the new PM method, we should remove the
legacy PM method.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/staging/gma500/power.c   |    9 +++++----
 drivers/staging/gma500/power.h   |    4 ++--
 drivers/staging/gma500/psb_drv.c |    6 ++----
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/gma500/power.c b/drivers/staging/gma500/power.c
index 5cd5023..972bea7 100644
--- a/drivers/staging/gma500/power.c
+++ b/drivers/staging/gma500/power.c
@@ -185,8 +185,9 @@ static bool gma_resume_pci(struct pci_dev *pdev)
  *	perform the necessary shut down steps and save enough state that
  *	we can undo this when resume is called.
  */
-int gma_power_suspend(struct pci_dev *pdev, pm_message_t state)
+int gma_power_suspend(struct device *_dev)
 {
+	struct pci_dev *pdev = container_of(_dev, struct pci_dev, dev);
 	struct drm_device *dev = pci_get_drvdata(pdev);
 	struct drm_psb_private *dev_priv = dev->dev_private;
 
@@ -210,8 +211,9 @@ int gma_power_suspend(struct pci_dev *pdev, pm_message_t state)
  *
  *	Resume the PCI side of the graphics and then the displays
  */
-int gma_power_resume(struct pci_dev *pdev)
+int gma_power_resume(struct device *_dev)
 {
+	struct pci_dev *pdev = container_of(_dev, struct pci_dev, dev);
 	struct drm_device *dev = pci_get_drvdata(pdev);
 
 	mutex_lock(&power_mutex);
@@ -295,8 +297,7 @@ void gma_power_end(struct drm_device *dev)
 
 int psb_runtime_suspend(struct device *dev)
 {
-	static pm_message_t dummy;
-	return gma_power_suspend(to_pci_dev(dev), dummy);
+	return gma_power_suspend(dev);
 }
 
 int psb_runtime_resume(struct device *dev)
diff --git a/drivers/staging/gma500/power.h b/drivers/staging/gma500/power.h
index 333b28d..1969d2e 100644
--- a/drivers/staging/gma500/power.h
+++ b/drivers/staging/gma500/power.h
@@ -39,8 +39,8 @@ void gma_power_uninit(struct drm_device *dev);
 /*
  * The kernel bus power management  will call these functions
  */
-int gma_power_suspend(struct pci_dev *pdev, pm_message_t state);
-int gma_power_resume(struct pci_dev *pdev);
+int gma_power_suspend(struct device *dev);
+int gma_power_resume(struct device *dev);
 
 /*
  * These are the functions the driver should use to wrap all hw access
diff --git a/drivers/staging/gma500/psb_drv.c b/drivers/staging/gma500/psb_drv.c
index b8b9864..f96a619 100644
--- a/drivers/staging/gma500/psb_drv.c
+++ b/drivers/staging/gma500/psb_drv.c
@@ -1144,6 +1144,8 @@ static void psb_remove(struct pci_dev *pdev)
 }
 
 static const struct dev_pm_ops psb_pm_ops = {
+	.resume = gma_power_resume,
+	.suspend = gma_power_suspend,
 	.runtime_suspend = psb_runtime_suspend,
 	.runtime_resume = psb_runtime_resume,
 	.runtime_idle = psb_runtime_idle,
@@ -1205,13 +1207,9 @@ static struct drm_driver driver = {
 static struct pci_driver psb_pci_driver = {
 	.name = DRIVER_NAME,
 	.id_table = pciidlist,
-	.resume = gma_power_resume,
-	.suspend = gma_power_suspend,
 	.probe = psb_probe,
 	.remove = psb_remove,
-#ifdef CONFIG_PM
 	.driver.pm = &psb_pm_ops,
-#endif
 };
 
 static int psb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)


  parent reply	other threads:[~2011-07-15 16:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 16:31 [PATCH 01/15] gma500: Cursor interface Alan Cox
2011-07-15 16:32 ` [PATCH 02/15] gma500: Move the 2D operations into DRM Alan Cox
2011-07-15 16:32 ` [PATCH 03/15] gma500: add an mmap ioctl Alan Cox
2011-07-15 16:33 ` [PATCH 04/15] gma500: allow the creation of 'stolen' memory objects Alan Cox
2011-07-15 16:33 ` Alan Cox [this message]
2011-07-15 16:33 ` [PATCH 06/15] gma500: Make crtc count a property of the device Alan Cox
2011-07-15 16:33 ` [PATCH 07/15] gma500: fix compile warnings when CONFIG_BACKLIGHT_CLASS_DEVICE is not defined Alan Cox
2011-07-15 16:34 ` [PATCH 08/15] gma500: skip getting modes via DDC on Moorestown Alan Cox
2011-07-15 16:34 ` [PATCH 09/15] gma500: Fix cdv warning on unused variable Alan Cox
2011-07-15 16:34 ` [PATCH 10/15] gma500: Add the Oaktrail HDMI support Alan Cox
2011-07-15 16:34 ` [PATCH 11/15] gma500: More Moorestown muddle meddling means MM maybe might modeset Alan Cox
2011-07-15 16:35 ` [PATCH 12/15] gma500@ Fix backlight range error Alan Cox
2011-07-15 16:35 ` [PATCH 13/15] gma500: Use the mrst helpers and power control for mode commit Alan Cox
2011-07-15 16:35 ` [PATCH 14/15] gma500: resync with Medfield progress Alan Cox
2011-07-15 16:35 ` [PATCH 15/15] gma500: Clean up the DPU config and make it runtime Alan Cox
2011-07-15 17:06 ` [PATCH 01/15] gma500: Cursor interface Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110715163319.28759.14659.stgit@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox