Commit 426d94a9 authored by Zhen Lei's avatar Zhen Lei Committed by Lee Jones

mfd: pcf50633: Use DEVICE_ATTR_ADMIN_RO macro

Use DEVICE_ATTR_ADMIN_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 a2cb660b
...@@ -77,8 +77,8 @@ int pcf50633_reg_clear_bits(struct pcf50633 *pcf, u8 reg, u8 val) ...@@ -77,8 +77,8 @@ int pcf50633_reg_clear_bits(struct pcf50633 *pcf, u8 reg, u8 val)
EXPORT_SYMBOL_GPL(pcf50633_reg_clear_bits); EXPORT_SYMBOL_GPL(pcf50633_reg_clear_bits);
/* sysfs attributes */ /* sysfs attributes */
static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr, static ssize_t dump_regs_show(struct device *dev,
char *buf) struct device_attribute *attr, char *buf)
{ {
struct pcf50633 *pcf = dev_get_drvdata(dev); struct pcf50633 *pcf = dev_get_drvdata(dev);
u8 dump[16]; u8 dump[16];
...@@ -106,10 +106,10 @@ static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr, ...@@ -106,10 +106,10 @@ static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr,
return buf1 - buf; return buf1 - buf;
} }
static DEVICE_ATTR(dump_regs, 0400, show_dump_regs, NULL); static DEVICE_ATTR_ADMIN_RO(dump_regs);
static ssize_t show_resume_reason(struct device *dev, static ssize_t resume_reason_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct pcf50633 *pcf = dev_get_drvdata(dev); struct pcf50633 *pcf = dev_get_drvdata(dev);
int n; int n;
...@@ -123,7 +123,7 @@ static ssize_t show_resume_reason(struct device *dev, ...@@ -123,7 +123,7 @@ static ssize_t show_resume_reason(struct device *dev,
return n; return n;
} }
static DEVICE_ATTR(resume_reason, 0400, show_resume_reason, NULL); static DEVICE_ATTR_ADMIN_RO(resume_reason);
static struct attribute *pcf_sysfs_entries[] = { static struct attribute *pcf_sysfs_entries[] = {
&dev_attr_dump_regs.attr, &dev_attr_dump_regs.attr,
......
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