diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-09-14 08:01:25 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-14 08:01:25 -0400 |
commit | d7f6884ae0ae6e406ec3500fcde16e8f51642460 (patch) | |
tree | efceb246a4fa12921b7dbd3946a88fa257684405 /drivers/w1/w1.h | |
parent | cd28ab6a4e50a7601d22752aa7ce0c8197b10bdf (diff) | |
parent | 2f4ba45a75d6383b4a1201169a808ffea416ffa0 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'drivers/w1/w1.h')
-rw-r--r-- | drivers/w1/w1.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index 4f0a986e33e..d8900780c3b 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h @@ -75,11 +75,9 @@ struct w1_slave struct w1_master *master; struct w1_family *family; + void *family_data; struct device dev; - struct completion dev_released; - - struct bin_attribute attr_bin; - struct device_attribute attr_name; + struct completion released; }; typedef void (* w1_slave_found_callback)(unsigned long, u64); @@ -179,7 +177,6 @@ struct w1_master struct device_driver *driver; struct device dev; - struct completion dev_released; struct completion dev_exited; struct w1_bus_master *bus_master; @@ -191,6 +188,21 @@ struct w1_master int w1_create_master_attributes(struct w1_master *); void w1_search(struct w1_master *dev, w1_slave_found_callback cb); +static inline struct w1_slave* dev_to_w1_slave(struct device *dev) +{ + return container_of(dev, struct w1_slave, dev); +} + +static inline struct w1_slave* kobj_to_w1_slave(struct kobject *kobj) +{ + return dev_to_w1_slave(container_of(kobj, struct device, kobj)); +} + +static inline struct w1_master* dev_to_w1_master(struct device *dev) +{ + return container_of(dev, struct w1_master, dev); +} + #endif /* __KERNEL__ */ #endif /* __W1_H */ |