diff mbox series

touchscreen: use kobj_to_dev() API

Message ID 1604893436-20206-1-git-send-email-wangqing@vivo.com (mailing list archive)
State Accepted
Commit 3fe781f4fab2cfad993807e2f14fa26dec6b9172
Headers show
Series touchscreen: use kobj_to_dev() API | expand

Commit Message

王擎 Nov. 9, 2020, 3:43 a.m. UTC
Use kobj_to_dev() instead of container_of().

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/input/touchscreen/ads7846.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dmitry Torokhov Nov. 9, 2020, 5:51 a.m. UTC | #1
On Mon, Nov 09, 2020 at 11:43:54AM +0800, Wang Qing wrote:
> Use kobj_to_dev() instead of container_of().
> 
> Signed-off-by: Wang Qing <wangqing@vivo.com>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 8fd7fc3..ee74da2
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -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 */