[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1370015872-3560-1-git-send-email-shuah.kh@samsung.com>
Date: Fri, 31 May 2013 09:57:52 -0600
From: Shuah Khan <shuah.kh@...sung.com>
To: a.zummo@...ertech.it, rafael.j.wysocki@...el.com
Cc: Shuah Khan <shuah.kh@...sung.com>, rtc-linux@...glegroups.com,
linux-kernel@...r.kernel.org, shuahkhan@...il.com
Subject: [PATCH] drivers/rtc/class: Convert from Legacy pm ops to dev_pm_ops
Convert drivers/rtc/class to use dev_pm_ops for power management and
remove Legacy PM ops hooks. With this change, rtc class registers
suspend/resume callbacks via class->pm (dev_pm_ops) instead of Legacy
class->suspend/resume. When __device_suspend() runs call-backs, it will
find class->pm ops for the rtc class.
Signed-off-by: Shuah Khan <shuah.kh@...sung.com>
---
drivers/rtc/class.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 6638540..21d83ec 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -135,9 +135,9 @@ static int rtc_resume(struct device *dev)
return 0;
}
+static SIMPLE_DEV_PM_OPS(rtc_class_dev_pm_ops, rtc_suspend, rtc_resume);
#else
-#define rtc_suspend NULL
-#define rtc_resume NULL
+#define rtc_class_dev_pm_ops NULL
#endif
@@ -336,8 +336,7 @@ static int __init rtc_init(void)
pr_err("couldn't create class\n");
return PTR_ERR(rtc_class);
}
- rtc_class->suspend = rtc_suspend;
- rtc_class->resume = rtc_resume;
+ rtc_class->pm = &rtc_class_dev_pm_ops;
rtc_dev_init();
rtc_sysfs_init(rtc_class);
return 0;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists