summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/via-cputemp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-04 19:29:37 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-04 19:29:37 -0800
commit7629bac64204ff256d3b2415767a7acb1401047b (patch)
tree02c8efad4f0b334dd715868e8b09d204e9fe0e6a /drivers/hwmon/via-cputemp.c
parentdcc75ddea1c3dde05db2f485d617dc8431177e33 (diff)
parent985e225142cf0cb826401f5448763f13ee712b3a (diff)
downloadlinux-7629bac64204ff256d3b2415767a7acb1401047b.tar.bz2
Merge tag 'hwmon-for-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck: - Add support for LM96000, DPS-650AB to existing drivers - Use permission specific SENSOR[_DEVICE]_ATTR variants in several drivers - Replace S_<PERMS> with octal values in several drivers - Update some license headers - Various minor fixes and improvements in several drivers * tag 'hwmon-for-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (89 commits) dt-bindings: hwmon: Add missing documentation for lm75 hwmon: (ad7418) Add device tree probing hwmon: (ad741x) Add DT bindings for Analog Devices AD741x hwmon: (ntc_thermistor) Convert to new hwmon API hwmon: (pwm-fan) Add optional regulator support dt-bindings: hwmon: Add optional regulator support to pwm-fan hwmon: (f71882fg) Mark expected switch fall-through hwmon: (ad7418) Catch I2C errors hwmon: (lm85) add support for LM96000 high frequencies hwmon: (lm85) support the LM96000 dt-bindings: Add LM96000 as a trivial device hwmon: (lm85) remove freq_map size hardcodes hwmon: (occ) Fix license headers hwmon: (via-cputemp) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (vexpress-hwmon) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (tmp421) Replace S_<PERMS> with octal values hwmon: (tmp103) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (tmp102) Replace S_<PERMS> with octal values hwmon: (tc74) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (tc654) Use permission specific SENSOR[_DEVICE]_ATTR variants ...
Diffstat (limited to 'drivers/hwmon/via-cputemp.c')
-rw-r--r--drivers/hwmon/via-cputemp.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c
index 0e81f287d305..cb94e4880014 100644
--- a/drivers/hwmon/via-cputemp.c
+++ b/drivers/hwmon/via-cputemp.c
@@ -60,8 +60,8 @@ struct via_cputemp_data {
* Sysfs stuff
*/
-static ssize_t show_name(struct device *dev, struct device_attribute
- *devattr, char *buf)
+static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
+ char *buf)
{
int ret;
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
@@ -74,8 +74,8 @@ static ssize_t show_name(struct device *dev, struct device_attribute
return ret;
}
-static ssize_t show_temp(struct device *dev,
- struct device_attribute *devattr, char *buf)
+static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
+ char *buf)
{
struct via_cputemp_data *data = dev_get_drvdata(dev);
u32 eax, edx;
@@ -102,10 +102,9 @@ static ssize_t cpu0_vid_show(struct device *dev,
return sprintf(buf, "%d\n", vid_from_reg(~edx & 0x7f, data->vrm));
}
-static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL,
- SHOW_TEMP);
-static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, show_name, NULL, SHOW_LABEL);
-static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, SHOW_NAME);
+static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, SHOW_TEMP);
+static SENSOR_DEVICE_ATTR_RO(temp1_label, name, SHOW_LABEL);
+static SENSOR_DEVICE_ATTR_RO(name, name, SHOW_NAME);
static struct attribute *via_cputemp_attributes[] = {
&sensor_dev_attr_name.dev_attr.attr,