summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2012-09-11 13:43:17 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-02 10:30:06 -0700
commit3f4d6d765aedf4c52195d1d3938b6c404a2f6555 (patch)
tree3182c074969184e40b02febb9dbf87c53080c22e /drivers/hwmon
parent17c7900f51d4cef95f95bbf3743bc9d19075052d (diff)
downloadlwn-3f4d6d765aedf4c52195d1d3938b6c404a2f6555.tar.gz
lwn-3f4d6d765aedf4c52195d1d3938b6c404a2f6555.zip
hwmon: (ad7314) Add 'name' sysfs attribute
commit 3ceefe4319636d89d4bdf40dca9471970f942e4f upstream. The 'name' sysfs attribute is mandatory for hwmon devices, but was missing in this driver. Cc: Jonathan Cameron <jic23@cam.ac.uk> 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/ad7314.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hwmon/ad7314.c b/drivers/hwmon/ad7314.c
index f85ce70d9677..9815f9cc8f7a 100644
--- a/drivers/hwmon/ad7314.c
+++ b/drivers/hwmon/ad7314.c
@@ -94,10 +94,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,
};