Skip to contentSkip to conversation

wireless: cw1200: Fix suspend

PATCH Applied Lars-Peter Clausen 2 participants 2 messages Mar 15, 2015 – Mar 20, 2015 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wireless: cw1200: Fix suspend

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.

---
 drivers/net/wireless/cw1200/cw1200_spi.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/net/wireless/cw1200/cw1200_spi.c +4 -7
index 964b64a..7603546 100644
@@ -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
 	},
 };
Signature · 1 line
1.8.0
Applied
#1 lore raw

Re: cw1200: Fix suspend

Quoted 9 lines

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.

Thanks, applied to wireless-drivers-next.git.

Kalle Valo