summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2021-06-02 13:43:32 +0200
committerLee Jones <lee.jones@linaro.org>2021-06-15 14:02:01 +0200
commit47ed390bac52c5814c03253d15a6ffe85ef69ba5 (patch)
treed4ac913ddd9bb984cffd9eab2c7ecdb3dd4187eb /drivers/mfd
parentmfd: wm831x: Use DEVICE_ATTR_RO macro (diff)
downloadlinux-47ed390bac52c5814c03253d15a6ffe85ef69ba5.tar.xz
linux-47ed390bac52c5814c03253d15a6ffe85ef69ba5.zip
mfd: ucb1x00-assabet: 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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/ucb1x00-assabet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/ucb1x00-assabet.c b/drivers/mfd/ucb1x00-assabet.c
index ecc9e9fc331d..6a389737c615 100644
--- a/drivers/mfd/ucb1x00-assabet.c
+++ b/drivers/mfd/ucb1x00-assabet.c
@@ -28,7 +28,7 @@ static ssize_t name##_show(struct device *dev, struct device_attribute *attr, \
ucb1x00_adc_disable(ucb); \
return sprintf(buf, "%d\n", val); \
} \
-static DEVICE_ATTR(name,0444,name##_show,NULL)
+static DEVICE_ATTR_RO(name)
UCB1X00_ATTR(vbatt, UCB_ADC_INP_AD1);
UCB1X00_ATTR(vcharger, UCB_ADC_INP_AD0);