提交 89cb4af8 编写于 作者: J Julia Lawall 提交者: Guenter Roeck

hwmon: (lm70) use permission-specific DEVICE_ATTR variants

Use DEVICE_ATTR_RO for read-only 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: NJulia Lawall <Julia.Lawall@lip6.fr>
[groeck: Updated description]
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 dc7a3265
......@@ -54,7 +54,7 @@ struct lm70 {
};
/* sysfs hook function */
static ssize_t lm70_sense_temp(struct device *dev,
static ssize_t temp1_input_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct lm70 *p_lm70 = dev_get_drvdata(dev);
......@@ -120,7 +120,7 @@ static ssize_t lm70_sense_temp(struct device *dev,
return status;
}
static DEVICE_ATTR(temp1_input, S_IRUGO, lm70_sense_temp, NULL);
static DEVICE_ATTR_RO(temp1_input);
static struct attribute *lm70_attrs[] = {
&dev_attr_temp1_input.attr,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册