All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] include/linux/w1: Use kobj_to_dev() API
@ 2021-06-18 14:18 zhouchuangao
  0 siblings, 0 replies; only message in thread
From: zhouchuangao @ 2021-06-18 14:18 UTC (permalink / raw)
  To: Evgeniy Polyakov, linux-kernel; +Cc: zhouchuangao

Use kobj_to_dev() API instead of container_of().

Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
---
 include/linux/w1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/w1.h b/include/linux/w1.h
index 9a2a0ef..55f01a4 100644
--- a/include/linux/w1.h
+++ b/include/linux/w1.h
@@ -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)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-18 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 14:18 [PATCH] include/linux/w1: Use kobj_to_dev() API zhouchuangao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.