From 3696a572cde5178b6092c30351ea0e90e91d2bb4 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 5 Jul 2012 20:23:21 +0000 Subject: [PATCH] --- yaml --- r: 320723 b: refs/heads/master c: 27130f0cc3ab97560384da437e4621fc4e94f21c h: refs/heads/master i: 320721: 04e8f52baadc8c69b53ec21e339a5ca1e34b7586 320719: ef2a993029cd31e3ab41019d40a58a534a989119 v: v3 --- [refs] | 2 +- trunk/drivers/mfd/wm831x-otp.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 09462cd28536..e9439f1ee288 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9dccf55f4cb011a7552a8a2749a580662f5ed8ed +refs/heads/master: 27130f0cc3ab97560384da437e4621fc4e94f21c diff --git a/trunk/drivers/mfd/wm831x-otp.c b/trunk/drivers/mfd/wm831x-otp.c index f742745ff354..b90f3e06b6c9 100644 --- a/trunk/drivers/mfd/wm831x-otp.c +++ b/trunk/drivers/mfd/wm831x-otp.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -66,6 +67,7 @@ static DEVICE_ATTR(unique_id, 0444, wm831x_unique_id_show, NULL); int wm831x_otp_init(struct wm831x *wm831x) { + char uuid[WM831X_UNIQUE_ID_LEN]; int ret; ret = device_create_file(wm831x->dev, &dev_attr_unique_id); @@ -73,6 +75,12 @@ int wm831x_otp_init(struct wm831x *wm831x) dev_err(wm831x->dev, "Unique ID attribute not created: %d\n", ret); + ret = wm831x_unique_id_read(wm831x, uuid); + if (ret == 0) + add_device_randomness(uuid, sizeof(uuid)); + else + dev_err(wm831x->dev, "Failed to read UUID: %d\n", ret); + return ret; }