linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] touchscreen: use kobj_to_dev() API
@ 2020-11-09  3:43 Wang Qing
  2020-11-09  5:51 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2020-11-09  3:43 UTC (permalink / raw)
  To: Dmitry Torokhov, Wang Qing, Alexandru Ardelean, linux-input,
	linux-kernel

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(-)

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 */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] touchscreen: use kobj_to_dev() API
  2020-11-09  3:43 [PATCH] touchscreen: use kobj_to_dev() API Wang Qing
@ 2020-11-09  5:51 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2020-11-09  5:51 UTC (permalink / raw)
  To: Wang Qing; +Cc: Alexandru Ardelean, linux-input, linux-kernel

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.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-09  5:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-09  3:43 [PATCH] touchscreen: use kobj_to_dev() API Wang Qing
2020-11-09  5:51 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).