projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
981ce06
)
mfd: ucb1x00-assabet: Use DEVICE_ATTR_RO macro
author
Zhen Lei
<thunder.leizhen@huawei.com>
Wed, 2 Jun 2021 11:43:32 +0000
(19:43 +0800)
committer
Lee Jones
<lee.jones@linaro.org>
Tue, 15 Jun 2021 12:02:01 +0000
(13:02 +0100)
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>
drivers/mfd/ucb1x00-assabet.c
patch
|
blob
|
history
diff --git
a/drivers/mfd/ucb1x00-assabet.c
b/drivers/mfd/ucb1x00-assabet.c
index ecc9e9fc331d6a30dfe748e95bf542e78bb53225..6a389737c6153bcf95350c92c26ed090571d545a 100644
(file)
--- 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);