Commit a2cb660b authored by Zhen Lei's avatar Zhen Lei Committed by Lee Jones

mfd: sm501: Use DEVICE_ATTR_RO macro

Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes
the code a bit shorter and easier to read.
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent ae7955f7
...@@ -1190,12 +1190,12 @@ static int sm501_register_gpio_i2c(struct sm501_devdata *sm, ...@@ -1190,12 +1190,12 @@ static int sm501_register_gpio_i2c(struct sm501_devdata *sm,
return 0; return 0;
} }
/* sm501_dbg_regs /* dbg_regs_show
* *
* Debug attribute to attach to parent device to show core registers * Debug attribute to attach to parent device to show core registers
*/ */
static ssize_t sm501_dbg_regs(struct device *dev, static ssize_t dbg_regs_show(struct device *dev,
struct device_attribute *attr, char *buff) struct device_attribute *attr, char *buff)
{ {
struct sm501_devdata *sm = dev_get_drvdata(dev) ; struct sm501_devdata *sm = dev_get_drvdata(dev) ;
...@@ -1213,7 +1213,7 @@ static ssize_t sm501_dbg_regs(struct device *dev, ...@@ -1213,7 +1213,7 @@ static ssize_t sm501_dbg_regs(struct device *dev,
} }
static DEVICE_ATTR(dbg_regs, 0444, sm501_dbg_regs, NULL); static DEVICE_ATTR_RO(dbg_regs);
/* sm501_init_reg /* sm501_init_reg
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment