Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 329beb71 authored by Julia Lawall's avatar Julia Lawall Committed by Guenter Roeck
Browse files

hwmon: (w83793) use permission-specific DEVICE_ATTR variants



Use DEVICE_ATTR_RW for read/write attributes. This simplifies the source
code, improves readbility, and reduces the chance of inconsistencies.

The conversion was done automatically using coccinelle. It was validated
by compiling both the old and the new source code and comparing its text,
data, and bss size.

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
[groeck: Updated description]
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 8258e490
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ static struct i2c_driver w83793_driver = {
};

static ssize_t
show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
vrm_show(struct device *dev, struct device_attribute *attr, char *buf)
{
	struct w83793_data *data = dev_get_drvdata(dev);
	return sprintf(buf, "%d\n", data->vrm);
@@ -342,7 +342,7 @@ show_vid(struct device *dev, struct device_attribute *attr, char *buf)
}

static ssize_t
store_vrm(struct device *dev, struct device_attribute *attr,
vrm_store(struct device *dev, struct device_attribute *attr,
	  const char *buf, size_t count)
{
	struct w83793_data *data = dev_get_drvdata(dev);
@@ -1169,7 +1169,7 @@ static struct sensor_device_attribute_2 w83793_vid[] = {
	SENSOR_ATTR_2(cpu0_vid, S_IRUGO, show_vid, NULL, NOT_USED, 0),
	SENSOR_ATTR_2(cpu1_vid, S_IRUGO, show_vid, NULL, NOT_USED, 1),
};
static DEVICE_ATTR(vrm, S_IWUSR | S_IRUGO, show_vrm, store_vrm);
static DEVICE_ATTR_RW(vrm);

static struct sensor_device_attribute_2 sda_single_files[] = {
	SENSOR_ATTR_2(intrusion0_alarm, S_IWUSR | S_IRUGO, show_alarm_beep,