From 03dd4cb26d967f9588437b0fc9cc0e8353322bb7 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Fri, 25 Mar 2016 03:53:42 -0300 Subject: Linux-libre 4.5-gnu --- drivers/mfd/wm831x-otp.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'drivers/mfd/wm831x-otp.c') diff --git a/drivers/mfd/wm831x-otp.c b/drivers/mfd/wm831x-otp.c index b90f3e06b..ebac0027f 100644 --- a/drivers/mfd/wm831x-otp.c +++ b/drivers/mfd/wm831x-otp.c @@ -47,20 +47,14 @@ static ssize_t wm831x_unique_id_show(struct device *dev, struct device_attribute *attr, char *buf) { struct wm831x *wm831x = dev_get_drvdata(dev); - int i, rval; + int rval; char id[WM831X_UNIQUE_ID_LEN]; - ssize_t ret = 0; rval = wm831x_unique_id_read(wm831x, id); if (rval < 0) return 0; - for (i = 0; i < WM831X_UNIQUE_ID_LEN; i++) - ret += sprintf(&buf[ret], "%02x", buf[i]); - - ret += sprintf(&buf[ret], "\n"); - - return ret; + return sprintf(buf, "%*phN\n", WM831X_UNIQUE_ID_LEN, id); } static DEVICE_ATTR(unique_id, 0444, wm831x_unique_id_show, NULL); -- cgit v1.2.3-54-g00ecf