mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 16:53:58 -05:00
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: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
ae7955f725
commit
a2cb660b2f
1 changed files with 4 additions and 4 deletions
|
@ -1190,13 +1190,13 @@ 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) ;
|
||||||
unsigned int reg;
|
unsigned int reg;
|
||||||
|
@ -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
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue