diff options
Diffstat (limited to 'drivers/w1/w1.h')
-rw-r--r-- | drivers/w1/w1.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index 4f0a986e33e3..f8308266d8d6 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h | |||
@@ -191,6 +191,21 @@ struct w1_master | |||
191 | int w1_create_master_attributes(struct w1_master *); | 191 | int w1_create_master_attributes(struct w1_master *); |
192 | void w1_search(struct w1_master *dev, w1_slave_found_callback cb); | 192 | void w1_search(struct w1_master *dev, w1_slave_found_callback cb); |
193 | 193 | ||
194 | static inline struct w1_slave* dev_to_w1_slave(struct device *dev) | ||
195 | { | ||
196 | return container_of(dev, struct w1_slave, dev); | ||
197 | } | ||
198 | |||
199 | static inline struct w1_slave* kobj_to_w1_slave(struct kobject *kobj) | ||
200 | { | ||
201 | return dev_to_w1_slave(container_of(kobj, struct device, kobj)); | ||
202 | } | ||
203 | |||
204 | static inline struct w1_master* dev_to_w1_master(struct device *dev) | ||
205 | { | ||
206 | return container_of(dev, struct w1_master, dev); | ||
207 | } | ||
208 | |||
194 | #endif /* __KERNEL__ */ | 209 | #endif /* __KERNEL__ */ |
195 | 210 | ||
196 | #endif /* __W1_H */ | 211 | #endif /* __W1_H */ |