2009-07-25 16:57:22

by Arnaud Faucher

[permalink] [raw]
Subject: [PATCH] net: irda: ali-ircc: switch driver to dev_pm_ops

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

Signed-off-by: Arnaud Faucher <[email protected]>
---
drivers/net/irda/ali-ircc.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index ad17955..4ddc478 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -52,15 +52,19 @@
#define ALI_IRCC_DRIVER_NAME "ali-ircc"

/* Power Management */
-static int ali_ircc_suspend(struct platform_device *dev, pm_message_t state);
-static int ali_ircc_resume(struct platform_device *dev);
+static int ali_ircc_suspend(struct device *dev);
+static int ali_ircc_resume(struct device *dev);

-static struct platform_driver ali_ircc_driver = {
+static struct dev_pm_ops ali_ircc_pm_ops = {
.suspend = ali_ircc_suspend,
.resume = ali_ircc_resume,
+};
+
+static struct platform_driver ali_ircc_driver = {
.driver = {
.name = ALI_IRCC_DRIVER_NAME,
.owner = THIS_MODULE,
+ .pm = &ali_ircc_pm_ops,
},
};

@@ -2120,9 +2124,9 @@ static int ali_ircc_is_receiving(struct ali_ircc_cb *self)
return status;
}

-static int ali_ircc_suspend(struct platform_device *dev, pm_message_t state)
+static int ali_ircc_suspend(struct device *dev)
{
- struct ali_ircc_cb *self = platform_get_drvdata(dev);
+ struct ali_ircc_cb *self = dev_get_drvdata(dev);

IRDA_MESSAGE("%s, Suspending\n", ALI_IRCC_DRIVER_NAME);

@@ -2136,9 +2140,9 @@ static int ali_ircc_suspend(struct platform_device *dev, pm_message_t state)
return 0;
}

-static int ali_ircc_resume(struct platform_device *dev)
+static int ali_ircc_resume(struct device *dev)
{
- struct ali_ircc_cb *self = platform_get_drvdata(dev);
+ struct ali_ircc_cb *self = dev_get_drvdata(dev);

if (!self->io.suspended)
return 0;
--
1.6.3.3