linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pcmcia: ds: fix suspend/resume
@ 2016-08-20 23:05 Russell King
  2016-08-27 12:05 ` Dominik Brodowski
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2016-08-20 23:05 UTC (permalink / raw)
  To: linux-pcmcia, linux-arm-kernel, linux-kernel

PCMCIA suspend/resume no longer works since the commit mentioned below,
as the callbacks are no longer made.  Convert the driver to the new
dev_pm_ops, which restores the suspend/resume functionality.  Tested on
the arm arch Assabet platform with a pcnet_cs CF card.

Fixes: aa8e54b559479 ("PM / sleep: Go direct_complete if driver has no callbacks")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/pcmcia/ds.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 489ea1098c96..69b5e811ea2b 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -977,7 +977,7 @@ static int pcmcia_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 
 /************************ runtime PM support ***************************/
 
-static int pcmcia_dev_suspend(struct device *dev, pm_message_t state);
+static int pcmcia_dev_suspend(struct device *dev);
 static int pcmcia_dev_resume(struct device *dev);
 
 static int runtime_suspend(struct device *dev)
@@ -985,7 +985,7 @@ static int runtime_suspend(struct device *dev)
 	int rc;
 
 	device_lock(dev);
-	rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND);
+	rc = pcmcia_dev_suspend(dev);
 	device_unlock(dev);
 	return rc;
 }
@@ -1135,7 +1135,7 @@ ATTRIBUTE_GROUPS(pcmcia_dev);
 
 /* PM support, also needed for reset */
 
-static int pcmcia_dev_suspend(struct device *dev, pm_message_t state)
+static int pcmcia_dev_suspend(struct device *dev)
 {
 	struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
 	struct pcmcia_driver *p_drv = NULL;
@@ -1410,6 +1410,9 @@ static struct class_interface pcmcia_bus_interface __refdata = {
 	.remove_dev = &pcmcia_bus_remove_socket,
 };
 
+static const struct dev_pm_ops pcmcia_bus_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(pcmcia_dev_suspend, pcmcia_dev_resume)
+};
 
 struct bus_type pcmcia_bus_type = {
 	.name = "pcmcia",
@@ -1418,8 +1421,7 @@ struct bus_type pcmcia_bus_type = {
 	.dev_groups = pcmcia_dev_groups,
 	.probe = pcmcia_device_probe,
 	.remove = pcmcia_device_remove,
-	.suspend = pcmcia_dev_suspend,
-	.resume = pcmcia_dev_resume,
+	.pm = &pcmcia_bus_pm_ops,
 };
 
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pcmcia: ds: fix suspend/resume
  2016-08-20 23:05 [PATCH] pcmcia: ds: fix suspend/resume Russell King
@ 2016-08-27 12:05 ` Dominik Brodowski
  2016-08-27 12:42   ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Brodowski @ 2016-08-27 12:05 UTC (permalink / raw)
  To: Russell King; +Cc: linux-pcmcia, linux-arm-kernel, linux-kernel

Russell,

On Sun, Aug 21, 2016 at 12:05:30AM +0100, Russell King wrote:
> PCMCIA suspend/resume no longer works since the commit mentioned below,
> as the callbacks are no longer made.  Convert the driver to the new
> dev_pm_ops, which restores the suspend/resume functionality.  Tested on
> the arm arch Assabet platform with a pcnet_cs CF card.
> 
> Fixes: aa8e54b559479 ("PM / sleep: Go direct_complete if driver has no callbacks")
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Looks goot to me. Can you push it upstream, please?

Best
	Dominik

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pcmcia: ds: fix suspend/resume
  2016-08-27 12:05 ` Dominik Brodowski
@ 2016-08-27 12:42   ` Russell King - ARM Linux
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2016-08-27 12:42 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: linux-pcmcia, linux-arm-kernel, linux-kernel

On Sat, Aug 27, 2016 at 02:05:22PM +0200, Dominik Brodowski wrote:
> Russell,
> 
> On Sun, Aug 21, 2016 at 12:05:30AM +0100, Russell King wrote:
> > PCMCIA suspend/resume no longer works since the commit mentioned below,
> > as the callbacks are no longer made.  Convert the driver to the new
> > dev_pm_ops, which restores the suspend/resume functionality.  Tested on
> > the arm arch Assabet platform with a pcnet_cs CF card.
> > 
> > Fixes: aa8e54b559479 ("PM / sleep: Go direct_complete if driver has no callbacks")
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> 
> Looks goot to me. Can you push it upstream, please?

I can do - should I take that as an Acked-by?

Thanks.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-27 12:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-20 23:05 [PATCH] pcmcia: ds: fix suspend/resume Russell King
2016-08-27 12:05 ` Dominik Brodowski
2016-08-27 12:42   ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).