Skip to contentSkip to conversation

touchscreen: use kobj_to_dev() API

PATCH Applied Wang Qing 2 participants 2 messages Nov 9, 2020

Subsystems (2)
lore
Share & tools
lore

Wang Qing

author
#0 lore raw

PATCH 1/1 touchscreen: use kobj_to_dev() API

Use kobj_to_dev() instead of container_of().

---
 drivers/input/touchscreen/ads7846.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/ads7846.c +1 -1
index 8fd7fc3..ee74da2
@@ -481,7 +481,7 @@ SHOW(in1_input, vbatt, vbatt_adjust)
 static umode_t ads7846_is_visible(struct kobject *kobj, struct attribute *attr,
 				  int index)
 {
-	struct device *dev = container_of(kobj, struct device, kobj);
+	struct device *dev = kobj_to_dev(kobj);
 	struct ads7846 *ts = dev_get_drvdata(dev);
 
 	if (ts->model == 7843 && index < 2)	/* in0, in1 */
Signature · 1 line
2.7.4