diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-09-11 16:43:17 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2012-09-18 16:20:35 -0400 |
commit | 3ceefe4319636d89d4bdf40dca9471970f942e4f (patch) | |
tree | 135fe7ebf4453c74288e8bb3c3a88b0bb171b503 /drivers/hwmon/ad7314.c | |
parent | 4e21f4eaa49f78d3e977e316514c941053871c76 (diff) |
hwmon: (ad7314) Add 'name' sysfs attribute
The 'name' sysfs attribute is mandatory for hwmon devices, but was missing
in this driver.
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Diffstat (limited to 'drivers/hwmon/ad7314.c')
-rw-r--r-- | drivers/hwmon/ad7314.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hwmon/ad7314.c b/drivers/hwmon/ad7314.c index cfec802cf9c..f915eb1c29f 100644 --- a/drivers/hwmon/ad7314.c +++ b/drivers/hwmon/ad7314.c | |||
@@ -87,10 +87,18 @@ static ssize_t ad7314_show_temperature(struct device *dev, | |||
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | static ssize_t ad7314_show_name(struct device *dev, | ||
91 | struct device_attribute *devattr, char *buf) | ||
92 | { | ||
93 | return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); | ||
94 | } | ||
95 | |||
96 | static DEVICE_ATTR(name, S_IRUGO, ad7314_show_name, NULL); | ||
90 | static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, | 97 | static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, |
91 | ad7314_show_temperature, NULL, 0); | 98 | ad7314_show_temperature, NULL, 0); |
92 | 99 | ||
93 | static struct attribute *ad7314_attributes[] = { | 100 | static struct attribute *ad7314_attributes[] = { |
101 | &dev_attr_name.attr, | ||
94 | &sensor_dev_attr_temp1_input.dev_attr.attr, | 102 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
95 | NULL, | 103 | NULL, |
96 | }; | 104 | }; |