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

Commit 93d72ac3 authored by Julia Lawall's avatar Julia Lawall Committed by Guenter Roeck
Browse files

hwmon: (nct6775) 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 e57959a6
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3127,14 +3127,14 @@ static const struct sensor_template_group nct6775_pwm_template_group = {
};
};


static ssize_t
static ssize_t
show_vid(struct device *dev, struct device_attribute *attr, char *buf)
cpu0_vid_show(struct device *dev, struct device_attribute *attr, char *buf)
{
{
	struct nct6775_data *data = dev_get_drvdata(dev);
	struct nct6775_data *data = dev_get_drvdata(dev);


	return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
	return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
}
}


static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
static DEVICE_ATTR_RO(cpu0_vid);


/* Case open detection */
/* Case open detection */