diff options
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r-- | drivers/w1/w1.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 5b49c9a937f0..c85d75ed835a 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -102,9 +102,6 @@ static ssize_t w1_default_read_bin(struct kobject *kobj, char *buf, loff_t off, | |||
102 | static struct device_attribute w1_slave_attribute = | 102 | static struct device_attribute w1_slave_attribute = |
103 | __ATTR(name, S_IRUGO, w1_default_read_name, NULL); | 103 | __ATTR(name, S_IRUGO, w1_default_read_name, NULL); |
104 | 104 | ||
105 | static struct device_attribute w1_slave_attribute_val = | ||
106 | __ATTR(value, S_IRUGO, w1_default_read_name, NULL); | ||
107 | |||
108 | static struct bin_attribute w1_slave_bin_attribute = { | 105 | static struct bin_attribute w1_slave_bin_attribute = { |
109 | .attr = { | 106 | .attr = { |
110 | .name = "w1_slave", | 107 | .name = "w1_slave", |
@@ -310,12 +307,9 @@ static int __w1_attach_slave_device(struct w1_slave *sl) | |||
310 | 307 | ||
311 | memcpy(&sl->attr_bin, &w1_slave_bin_attribute, sizeof(sl->attr_bin)); | 308 | memcpy(&sl->attr_bin, &w1_slave_bin_attribute, sizeof(sl->attr_bin)); |
312 | memcpy(&sl->attr_name, &w1_slave_attribute, sizeof(sl->attr_name)); | 309 | memcpy(&sl->attr_name, &w1_slave_attribute, sizeof(sl->attr_name)); |
313 | memcpy(&sl->attr_val, &w1_slave_attribute_val, sizeof(sl->attr_val)); | ||
314 | 310 | ||
315 | sl->attr_bin.read = sl->family->fops->rbin; | 311 | sl->attr_bin.read = sl->family->fops->rbin; |
316 | sl->attr_name.show = sl->family->fops->rname; | 312 | sl->attr_name.show = sl->family->fops->rname; |
317 | sl->attr_val.show = sl->family->fops->rval; | ||
318 | sl->attr_val.attr.name = sl->family->fops->rvalname; | ||
319 | 313 | ||
320 | err = device_create_file(&sl->dev, &sl->attr_name); | 314 | err = device_create_file(&sl->dev, &sl->attr_name); |
321 | if (err < 0) { | 315 | if (err < 0) { |
@@ -326,23 +320,12 @@ static int __w1_attach_slave_device(struct w1_slave *sl) | |||
326 | return err; | 320 | return err; |
327 | } | 321 | } |
328 | 322 | ||
329 | err = device_create_file(&sl->dev, &sl->attr_val); | ||
330 | if (err < 0) { | ||
331 | dev_err(&sl->dev, | ||
332 | "sysfs file creation for [%s] failed. err=%d\n", | ||
333 | sl->dev.bus_id, err); | ||
334 | device_remove_file(&sl->dev, &sl->attr_name); | ||
335 | device_unregister(&sl->dev); | ||
336 | return err; | ||
337 | } | ||
338 | |||
339 | err = sysfs_create_bin_file(&sl->dev.kobj, &sl->attr_bin); | 323 | err = sysfs_create_bin_file(&sl->dev.kobj, &sl->attr_bin); |
340 | if (err < 0) { | 324 | if (err < 0) { |
341 | dev_err(&sl->dev, | 325 | dev_err(&sl->dev, |
342 | "sysfs file creation for [%s] failed. err=%d\n", | 326 | "sysfs file creation for [%s] failed. err=%d\n", |
343 | sl->dev.bus_id, err); | 327 | sl->dev.bus_id, err); |
344 | device_remove_file(&sl->dev, &sl->attr_name); | 328 | device_remove_file(&sl->dev, &sl->attr_name); |
345 | device_remove_file(&sl->dev, &sl->attr_val); | ||
346 | device_unregister(&sl->dev); | 329 | device_unregister(&sl->dev); |
347 | return err; | 330 | return err; |
348 | } | 331 | } |
@@ -428,7 +411,6 @@ static void w1_slave_detach(struct w1_slave *sl) | |||
428 | 411 | ||
429 | sysfs_remove_bin_file (&sl->dev.kobj, &sl->attr_bin); | 412 | sysfs_remove_bin_file (&sl->dev.kobj, &sl->attr_bin); |
430 | device_remove_file(&sl->dev, &sl->attr_name); | 413 | device_remove_file(&sl->dev, &sl->attr_name); |
431 | device_remove_file(&sl->dev, &sl->attr_val); | ||
432 | device_unregister(&sl->dev); | 414 | device_unregister(&sl->dev); |
433 | w1_family_put(sl->family); | 415 | w1_family_put(sl->family); |
434 | 416 | ||