summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2021-06-02 19:43:31 +0800
committerLee Jones <lee.jones@linaro.org>2021-06-15 13:01:45 +0100
commit981ce06ab8dd642aff90ce91726da1c5e73eb25b (patch)
tree6f0ea59028ca4b71764cc38e30a4aa86f0b3a564 /drivers/mfd
parent3da286aa4a8c1fe807ac082edc043c1d2d538d28 (diff)
downloadlinux-981ce06ab8dd642aff90ce91726da1c5e73eb25b.tar.bz2
mfd: wm831x: 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> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/wm831x-otp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mfd/wm831x-otp.c b/drivers/mfd/wm831x-otp.c
index afe59d52dd74..25f5d9fe33a1 100644
--- a/drivers/mfd/wm831x-otp.c
+++ b/drivers/mfd/wm831x-otp.c
@@ -38,8 +38,8 @@ static int wm831x_unique_id_read(struct wm831x *wm831x, char *id)
return 0;
}
-static ssize_t wm831x_unique_id_show(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t unique_id_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct wm831x *wm831x = dev_get_drvdata(dev);
int rval;
@@ -52,7 +52,7 @@ static ssize_t wm831x_unique_id_show(struct device *dev,
return sprintf(buf, "%*phN\n", WM831X_UNIQUE_ID_LEN, id);
}
-static DEVICE_ATTR(unique_id, 0444, wm831x_unique_id_show, NULL);
+static DEVICE_ATTR_RO(unique_id);
int wm831x_otp_init(struct wm831x *wm831x)
{