hwmon: (ad7314) Add 'name' sysfs attribute
Guenter Roeck
maintainerPATCH 4/4 hwmon: (ad7314) Add 'name' sysfs attribute
The 'name' sysfs attribute is mandatory for hwmon devices, but was missing in this driver.
---
candidate for -stable
drivers/hwmon/ad7314.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/hwmon/ad7314.c +8 -0
@@ -87,10 +87,18 @@ static ssize_t ad7314_show_temperature(struct device *dev, } } +static ssize_t ad7314_show_name (struct device *dev, +struct device_attribute *devattr,char *buf) +{ +return sprintf (buf,"%s\n" ,to_spi_device (dev)->modalias); +} + +static DEVICE_ATTR(name, S_IRUGO, ad7314_show_name, NULL); static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, ad7314_show_temperature, NULL, 0);static struct attribute *ad7314_attributes[] = { + &dev_attr_name.attr, &sensor_dev_attr_temp1_input.dev_attr.attr,NULL , };
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerping
Quoted 38 lines · Guenter Roeck
The 'name' sysfs attribute is mandatory for hwmon devices, but was missing in this driver.
Cc Jonathan Cameron <[email protected]>Signed-off-by Guenter Roeck <[email protected]>---
candidate for -stabledrivers/hwmon/ad7314.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/hwmon/ad7314.c +8
-0@@ -87,10 +87,18 @@ static ssize_t ad7314_show_temperature(struct device *dev, } } +static ssize_t ad7314_show_name (struct device *dev, +struct device_attribute *devattr,char *buf) +{ +return sprintf (buf,"%s\n" ,to_spi_device (dev)->modalias); +} + +static DEVICE_ATTR(name, S_IRUGO, ad7314_show_name, NULL); static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, ad7314_show_temperature, NULL, 0);static struct attribute *ad7314_attributes[] = { + &dev_attr_name.attr, &sensor_dev_attr_temp1_input.dev_attr.attr,NULL , };Signature · 1 line
1.7.9.7
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 24 lines · Guenter Roeck
The 'name' sysfs attribute is mandatory for hwmon devices, but was missing in this driver.
Cc Jonathan Cameron <[email protected]>Signed-off-by Guenter Roeck <[email protected]>---
candidate for -stabledrivers/hwmon/ad7314.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/hwmon/ad7314.c +5
-0@@ -87,10 +87,18 @@ static ssize_t ad7314_show_temperature(struct device *dev, } } +static ssize_t ad7314_show_name (struct device *dev, +struct device_attribute *devattr,char *buf) +{ +return sprintf (buf,"%s\n" ,to_spi_device (dev)->modalias); +}
drivers/hwmon/ad7314.c static ssize_t ad7314_show_temperature(struct device *dev, · line 104
Quoted 10 lines
drivers/hwmon/ad7314.c +3
-0+ +static DEVICE_ATTR(name, S_IRUGO, ad7314_show_name, NULL); static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, ad7314_show_temperature, NULL, 0);static struct attribute *ad7314_attributes[] = { + &dev_attr_name.attr, &sensor_dev_attr_temp1_input.dev_attr.attr,NULL , };
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 5 lines · Guenter Roeck
ping
Quoted 2 lines · Guenter Roeck
The 'name' sysfs attribute is mandatory for hwmon devices, but was missing in this driver.
Sorry, completely forgot about this.
Quoted 27 lines
Quoted 27 lines
Cc Jonathan Cameron <[email protected]>Signed-off-by Guenter Roeck <[email protected]>---
candidate for -stabledrivers/hwmon/ad7314.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/hwmon/ad7314.c +7
-0@@ -87,10 +87,18 @@ static ssize_t ad7314_show_temperature(struct device *dev, } } +static ssize_t ad7314_show_name (struct device *dev, +struct device_attribute *devattr,char *buf) +{ +return sprintf (buf,"%s\n" ,to_spi_device (dev)->modalias); +} + +static DEVICE_ATTR(name, S_IRUGO, ad7314_show_name, NULL); static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, ad7314_show_temperature, NULL, 0);
Quoted 9 lines
Quoted 9 lines
drivers/hwmon/ad7314.c +1
-0static struct attribute *ad7314_attributes[] = { + &dev_attr_name.attr, &sensor_dev_attr_temp1_input.dev_attr.attr,NULL , };Signature · 1 line
1.7.9.7
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors