Skip to contentSkip to conversation

pcspkr: switch driver to dev_pm_ops

PATCH Applied Frans Pop 2 participants 2 messages Jul 8, 2009 – Jul 9, 2009

Subsystems (2)
lore
Share & tools
lore

Frans Pop

author
#0 lore raw

PATCH 1/1 pcspkr: switch driver to dev_pm_ops

Gets rid of the following warning:
Platform driver 'pcspkr' needs updating - please use dev_pm_ops

Cc Rafael J. Wysocki <[email protected]>

---

Looked straightforward enough for me to give it a shot.

drivers/input/misc/pcspkr.c +6 -2
index 6d67af5..21cb755 100644
@@ -114,7 +114,7 @@ static int __devexit pcspkr_remove(struct platform_device *dev)
 	return 0;
 }
 
-static int pcspkr_suspend(struct platform_device *dev, pm_message_t state)
+static int pcspkr_suspend(struct device *dev)
 {
 	pcspkr_event(NULL, EV_SND, SND_BELL, 0);
 
@@ -127,14 +127,18 @@ static void pcspkr_shutdown(struct platform_device *dev)
 	pcspkr_event(NULL, EV_SND, SND_BELL, 0);
 }
 
+static struct dev_pm_ops pcspkr_pm_ops = {
+	.suspend = pcspkr_suspend,
+};
+
 static struct platform_driver pcspkr_platform_driver = {
 	.driver		= {
 		.name	= "pcspkr",
 		.owner	= THIS_MODULE,
+		.pm	= &pcspkr_pm_ops,
 	},
 	.probe		= pcspkr_probe,
 	.remove		= __devexit_p(pcspkr_remove),
-	.suspend	= pcspkr_suspend,
 	.shutdown	= pcspkr_shutdown,
 };