This reduces #ifdefs in the code. Also, CONFIG_PM_SLEEP is used
to avoid warnings of unused functions if CONFIG_PM_SLEEP is not
defined.

Signed-off-by: Jingoo Han <[email protected]>
---
 drivers/video/backlight/da903x_bl.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/video/backlight/da903x_bl.c 
b/drivers/video/backlight/da903x_bl.c
index 8179cef..c625f6d 100644
--- a/drivers/video/backlight/da903x_bl.c
+++ b/drivers/video/backlight/da903x_bl.c
@@ -161,7 +161,7 @@ static int da903x_backlight_remove(struct platform_device 
*pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int da903x_backlight_suspend(struct device *dev)
 {
        struct backlight_device *bl = dev_get_drvdata(dev);
@@ -176,20 +176,16 @@ static int da903x_backlight_resume(struct device *dev)
        backlight_update_status(bl);
        return 0;
 }
-
-static const struct dev_pm_ops da903x_backlight_pm_ops = {
-       .suspend        = da903x_backlight_suspend,
-       .resume         = da903x_backlight_resume,
-};
 #endif
 
+static SIMPLE_DEV_PM_OPS(da903x_backlight_pm_ops, da903x_backlight_suspend,
+                       da903x_backlight_resume);
+
 static struct platform_driver da903x_backlight_driver = {
        .driver         = {
                .name   = "da903x-backlight",
                .owner  = THIS_MODULE,
-#ifdef CONFIG_PM
                .pm     = &da903x_backlight_pm_ops,
-#endif
        },
        .probe          = da903x_backlight_probe,
        .remove         = da903x_backlight_remove,
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to