Commit 981ce06a authored by Zhen Lei's avatar Zhen Lei Committed by Lee Jones
Browse files

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: default avatarZhen Lei <thunder.leizhen@huawei.com>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 3da286aa
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ static int wm831x_unique_id_read(struct wm831x *wm831x, char *id)
	return 0;
}

static ssize_t wm831x_unique_id_show(struct device *dev,
static ssize_t unique_id_show(struct device *dev,
			      struct device_attribute *attr, char *buf)
{
	struct wm831x *wm831x = dev_get_drvdata(dev);
@@ -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)
{