* [PATCH] wireless: cw1200: Fix suspend
@ 2015-03-15 13:26 Lars-Peter Clausen
2015-03-20 6:31 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2015-03-15 13:26 UTC (permalink / raw)
To: Kalle Valo; +Cc: Solomon Peachy, linux-wireless, Lars-Peter Clausen
The cw1200 driver implements suspend and resume callbacks and assigns them
to the suspend and resume fields of the device_driver struct. These
callbacks are never actually called by anything though.
Modify the driver to properly use dev_pm_ops so that the suspend function
is actually executed upon suspend and drop the empty resume function.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/net/wireless/cw1200/cw1200_spi.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c
index 964b64a..7603546 100644
--- a/drivers/net/wireless/cw1200/cw1200_spi.c
+++ b/drivers/net/wireless/cw1200/cw1200_spi.c
@@ -447,7 +447,7 @@ static int cw1200_spi_disconnect(struct spi_device *func)
}
#ifdef CONFIG_PM
-static int cw1200_spi_suspend(struct device *dev, pm_message_t state)
+static int cw1200_spi_suspend(struct device *dev)
{
struct hwbus_priv *self = spi_get_drvdata(to_spi_device(dev));
@@ -458,10 +458,8 @@ static int cw1200_spi_suspend(struct device *dev, pm_message_t state)
return 0;
}
-static int cw1200_spi_resume(struct device *dev)
-{
- return 0;
-}
+static SIMPLE_DEV_PM_OPS(cw1200_pm_ops, cw1200_spi_suspend, NULL);
+
#endif
static struct spi_driver spi_driver = {
@@ -472,8 +470,7 @@ static struct spi_driver spi_driver = {
.bus = &spi_bus_type,
.owner = THIS_MODULE,
#ifdef CONFIG_PM
- .suspend = cw1200_spi_suspend,
- .resume = cw1200_spi_resume,
+ .pm = &cw1200_pm_ops,
#endif
},
};
--
1.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: cw1200: Fix suspend
2015-03-15 13:26 [PATCH] wireless: cw1200: Fix suspend Lars-Peter Clausen
@ 2015-03-20 6:31 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-03-20 6:31 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Solomon Peachy, linux-wireless, Lars-Peter Clausen
> The cw1200 driver implements suspend and resume callbacks and assigns them
> to the suspend and resume fields of the device_driver struct. These
> callbacks are never actually called by anything though.
>
> Modify the driver to properly use dev_pm_ops so that the suspend function
> is actually executed upon suspend and drop the empty resume function.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-20 6:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-15 13:26 [PATCH] wireless: cw1200: Fix suspend Lars-Peter Clausen
2015-03-20 6:31 ` Kalle Valo
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).