mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
hwmon: (ad7314) Add 'name' sysfs attribute
commit 3ceefe4319
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>
This commit is contained in:
parent
17c7900f51
commit
3f4d6d765a
1 changed files with 8 additions and 0 deletions
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue