aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r--drivers/w1/w1.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index b2fe0f7b0b7c..39888af6d33d 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -89,15 +89,13 @@ static int w1_master_remove(struct device *dev)
89 89
90static void w1_master_release(struct device *dev) 90static void w1_master_release(struct device *dev)
91{ 91{
92 struct w1_master *md = container_of(dev, struct w1_master, dev); 92 struct w1_master *md = dev_to_w1_master(dev);
93
94 complete(&md->dev_released); 93 complete(&md->dev_released);
95} 94}
96 95
97static void w1_slave_release(struct device *dev) 96static void w1_slave_release(struct device *dev)
98{ 97{
99 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); 98 struct w1_slave *sl = dev_to_w1_slave(dev);
100
101 complete(&sl->dev_released); 99 complete(&sl->dev_released);
102} 100}
103 101
@@ -162,7 +160,7 @@ struct device w1_slave_device = {
162 160
163static ssize_t w1_master_attribute_show_name(struct device *dev, struct device_attribute *attr, char *buf) 161static ssize_t w1_master_attribute_show_name(struct device *dev, struct device_attribute *attr, char *buf)
164{ 162{
165 struct w1_master *md = container_of(dev, struct w1_master, dev); 163 struct w1_master *md = dev_to_w1_master(dev);
166 ssize_t count; 164 ssize_t count;
167 165
168 if (down_interruptible (&md->mutex)) 166 if (down_interruptible (&md->mutex))
@@ -179,7 +177,7 @@ static ssize_t w1_master_attribute_store_search(struct device * dev,
179 struct device_attribute *attr, 177 struct device_attribute *attr,
180 const char * buf, size_t count) 178 const char * buf, size_t count)
181{ 179{
182 struct w1_master *md = container_of(dev, struct w1_master, dev); 180 struct w1_master *md = dev_to_w1_master(dev);
183 181
184 if (down_interruptible (&md->mutex)) 182 if (down_interruptible (&md->mutex))
185 return -EBUSY; 183 return -EBUSY;
@@ -195,7 +193,7 @@ static ssize_t w1_master_attribute_show_search(struct device *dev,
195 struct device_attribute *attr, 193 struct device_attribute *attr,
196 char *buf) 194 char *buf)
197{ 195{
198 struct w1_master *md = container_of(dev, struct w1_master, dev); 196 struct w1_master *md = dev_to_w1_master(dev);
199 ssize_t count; 197 ssize_t count;
200 198
201 if (down_interruptible (&md->mutex)) 199 if (down_interruptible (&md->mutex))
@@ -210,7 +208,7 @@ static ssize_t w1_master_attribute_show_search(struct device *dev,
210 208
211static ssize_t w1_master_attribute_show_pointer(struct device *dev, struct device_attribute *attr, char *buf) 209static ssize_t w1_master_attribute_show_pointer(struct device *dev, struct device_attribute *attr, char *buf)
212{ 210{
213 struct w1_master *md = container_of(dev, struct w1_master, dev); 211 struct w1_master *md = dev_to_w1_master(dev);
214 ssize_t count; 212 ssize_t count;
215 213
216 if (down_interruptible(&md->mutex)) 214 if (down_interruptible(&md->mutex))
@@ -231,7 +229,7 @@ static ssize_t w1_master_attribute_show_timeout(struct device *dev, struct devic
231 229
232static ssize_t w1_master_attribute_show_max_slave_count(struct device *dev, struct device_attribute *attr, char *buf) 230static ssize_t w1_master_attribute_show_max_slave_count(struct device *dev, struct device_attribute *attr, char *buf)
233{ 231{
234 struct w1_master *md = container_of(dev, struct w1_master, dev); 232 struct w1_master *md = dev_to_w1_master(dev);
235 ssize_t count; 233 ssize_t count;
236 234
237 if (down_interruptible(&md->mutex)) 235 if (down_interruptible(&md->mutex))
@@ -245,7 +243,7 @@ static ssize_t w1_master_attribute_show_max_slave_count(struct device *dev, stru
245 243
246static ssize_t w1_master_attribute_show_attempts(struct device *dev, struct device_attribute *attr, char *buf) 244static ssize_t w1_master_attribute_show_attempts(struct device *dev, struct device_attribute *attr, char *buf)
247{ 245{
248 struct w1_master *md = container_of(dev, struct w1_master, dev); 246 struct w1_master *md = dev_to_w1_master(dev);
249 ssize_t count; 247 ssize_t count;
250 248
251 if (down_interruptible(&md->mutex)) 249 if (down_interruptible(&md->mutex))
@@ -259,7 +257,7 @@ static ssize_t w1_master_attribute_show_attempts(struct device *dev, struct devi
259 257
260static ssize_t w1_master_attribute_show_slave_count(struct device *dev, struct device_attribute *attr, char *buf) 258static ssize_t w1_master_attribute_show_slave_count(struct device *dev, struct device_attribute *attr, char *buf)
261{ 259{
262 struct w1_master *md = container_of(dev, struct w1_master, dev); 260 struct w1_master *md = dev_to_w1_master(dev);
263 ssize_t count; 261 ssize_t count;
264 262
265 if (down_interruptible(&md->mutex)) 263 if (down_interruptible(&md->mutex))
@@ -273,7 +271,7 @@ static ssize_t w1_master_attribute_show_slave_count(struct device *dev, struct d
273 271
274static ssize_t w1_master_attribute_show_slaves(struct device *dev, struct device_attribute *attr, char *buf) 272static ssize_t w1_master_attribute_show_slaves(struct device *dev, struct device_attribute *attr, char *buf)
275{ 273{
276 struct w1_master *md = container_of(dev, struct w1_master, dev); 274 struct w1_master *md = dev_to_w1_master(dev);
277 int c = PAGE_SIZE; 275 int c = PAGE_SIZE;
278 276
279 if (down_interruptible(&md->mutex)) 277 if (down_interruptible(&md->mutex))