rtc: sysfs: use kobj_to_dev

use kobj_to_dev instead of open-conding it

Signed-off-by: suguosong <suguosong@xiaomi.com>
Link: https://lore.kernel.org/r/20200225021923.8570-1-guosongsu@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
suguosong 2020-02-25 10:19:23 +08:00 committed by Alexandre Belloni
parent 66e4f4a9cc
commit ae243ef0af

View File

@ -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;