lkml.org 
[lkml]   [2020]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2] w1: Use kobj_to_dev() API
Date
Use kobj_to_dev() instead of container_of()

Signed-off-by: Wang Qing <wangqing@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 cebf346..7f45174
--- 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
\
 
 \ /
  Last update: 2020-09-17 09:43    [W:0.025 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site