diff mbox series

RTC: use kobj_to_dev

Message ID 20200225021923.8570-1-guosongsu@gmail.com
State Accepted
Headers show
Series RTC: use kobj_to_dev | expand

Commit Message

guosongsu@gmail.com Feb. 25, 2020, 2:19 a.m. UTC
From: suguosong <suguosong@xiaomi.com>

use kobj_to_dev instead of open-conding it

Signed-off-by: suguosong <suguosong@xiaomi.com>
---
 drivers/rtc/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexandre Belloni March 3, 2020, 4:09 p.m. UTC | #1
On 25/02/2020 10:19:23+0800, guosongsu@gmail.com wrote:
> From: suguosong <suguosong@xiaomi.com>
> 
> use kobj_to_dev instead of open-conding it
> 
> Signed-off-by: suguosong <suguosong@xiaomi.com>
> ---
>  drivers/rtc/sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/rtc/sysfs.c b/drivers/rtc/sysfs.c
index b7ca7d79fb28..950fac0d41ff 100644
--- a/drivers/rtc/sysfs.c
+++ b/drivers/rtc/sysfs.c
@@ -279,7 +279,7 @@  static bool rtc_does_wakealarm(struct rtc_device *rtc)
 static umode_t rtc_attr_is_visible(struct kobject *kobj,
 				   struct attribute *attr, int n)
 {
-	struct device *dev = container_of(kobj, struct device, kobj);
+	struct device *dev = kobj_to_dev(kobj);
 	struct rtc_device *rtc = to_rtc_device(dev);
 	umode_t mode = attr->mode;