Skip to contentSkip to conversation

RTC: use kobj_to_dev

PATCH Applied [email protected] 2 participants 2 messages Feb 25, 2020 – Mar 3, 2020 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RTC: use kobj_to_dev

From: suguosong <[email protected]>

use kobj_to_dev instead of open-conding it

---
 drivers/rtc/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/sysfs.c +1 -1
index b7ca7d79fb28..950fac0d41ff 100644
@@ -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;
 
Signature · 1 line
2.14.1
maintainer Applied
#1 lore raw
Quoted 9 lines · On 25/02/2020 10:19:23+0800, [email protected] wrote:

From: suguosong <[email protected]>

use kobj_to_dev instead of open-conding it

---
 drivers/rtc/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com