Skip to contentSkip to conversation

w1: Switch to using the new API kobj_to_dev()

PATCH New Yang Li 1 participant 1 message Feb 22, 2021 W1 dallas's 1-wire bus

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 w1: Switch to using the new API kobj_to_dev()

fixed the following coccicheck:
./include/linux/w1.h:314:62-63: WARNING opportunity for kobj_to_dev()

---
 include/linux/w1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/w1.h +1 -1
index 949d3b1..93f3be8 100644
@@ -311,7 +311,7 @@ static inline struct w1_slave* dev_to_w1_slave(struct device *dev)
 
 static inline struct w1_slave* kobj_to_w1_slave(struct kobject *kobj)
 {
-	return dev_to_w1_slave(container_of(kobj, struct device, kobj));
+	return dev_to_w1_slave(kobj_to_dev(kobj));
 }
 
 static inline struct w1_master* dev_to_w1_master(struct device *dev)
Signature · 1 line
1.8.3.1