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

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
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1190,12 +1190,12 @@ static int sm501_register_gpio_i2c(struct sm501_devdata *sm,
	return 0;
}

/* sm501_dbg_regs
/* dbg_regs_show
 *
 * 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 sm501_devdata *sm = dev_get_drvdata(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
 *