From db2d0008de519c5db6baec45f7831e08790301cf Mon Sep 17 00:00:00 2001 From: Evgeniy Polyakov Date: Thu, 11 Aug 2005 17:27:49 +0400 Subject: [PATCH] w1: Added inline functions on top of container_of(). Signed-off-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- drivers/w1/w1.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/w1/w1.h') diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index 4f0a986e33e..f8308266d8d 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h @@ -191,6 +191,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 */ -- cgit v1.2.3 From d2a4ef6a0ce4d841293b49bf2cdc17a0ebfaaf9d Mon Sep 17 00:00:00 2001 From: Evgeniy Polyakov Date: Thu, 11 Aug 2005 17:27:50 +0400 Subject: [PATCH] w1: Added add/remove slave callbacks. Patch is based on work from Ben Gardner Signed-off-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- drivers/w1/w1.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/w1/w1.h') diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index f8308266d8d..13edc82bc7d 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h @@ -77,9 +77,6 @@ struct w1_slave struct w1_family *family; struct device dev; struct completion dev_released; - - struct bin_attribute attr_bin; - struct device_attribute attr_name; }; typedef void (* w1_slave_found_callback)(unsigned long, u64); -- cgit v1.2.3 From 3aca692d3ec7cf89da4575f598e41f74502b22d7 Mon Sep 17 00:00:00 2001 From: Evgeniy Polyakov Date: Thu, 11 Aug 2005 17:27:50 +0400 Subject: [PATCH] w1: Detouching bug fixed. Signed-off-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- drivers/w1/w1.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/w1/w1.h') diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index 13edc82bc7d..6cc7f0c5d43 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h @@ -76,7 +76,7 @@ struct w1_slave struct w1_master *master; struct w1_family *family; struct device dev; - struct completion dev_released; + struct completion released; }; typedef void (* w1_slave_found_callback)(unsigned long, u64); @@ -176,7 +176,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; -- cgit v1.2.3 From a45f105ad4b456f99f622642056ae533f70710b7 Mon Sep 17 00:00:00 2001 From: Evgeniy Polyakov Date: Wed, 17 Aug 2005 15:19:08 +0400 Subject: [PATCH] w1: added private family data into w1_slave strucutre. Add family_data to struct w1_slave. Signed-off-by: Ben Gardner Signed-off-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- drivers/w1/w1.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/w1/w1.h') diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index 6cc7f0c5d43..d8900780c3b 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h @@ -75,6 +75,7 @@ struct w1_slave struct w1_master *master; struct w1_family *family; + void *family_data; struct device dev; struct completion released; }; -- cgit v1.2.3