mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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>
This commit is contained in:
parent
981ce06ab8
commit
47ed390bac
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user