Skip to contentSkip to conversation

i2c: Use kobj_to_dev() API

PATCH In review Wang Qing 2 participants 2 messages Sep 17, 2020 – Sep 21, 2020

Subsystems (2)
lore
Share & tools
lore

Wang Qing

author
#0 lore raw

PATCH 1/1 i2c: Use kobj_to_dev() API

Use kobj_to_dev() instead of container_of()

---
 include/linux/i2c.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/i2c.h +1 -1
index fc55ea4..5662265
@@ -344,7 +344,7 @@ const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id,
 
 static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
 {
-	struct device * const dev = container_of(kobj, struct device, kobj);
+	struct device * const dev = kobj_to_dev(kobj);
 	return to_i2c_client(dev);
 }
 
Signature · 1 line
2.7.4