From: Michał Mirosław Date: Thu, 17 Aug 2017 13:56:11 +0000 (+0200) Subject: iio: magnetometer: ak8974: add_device_randomness (serial number) X-Git-Tag: v4.14-rc1~148^2~228^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=408cc6eb1e3adc43a434d5d584708c2a1d2c6c32;p=platform%2Fkernel%2Flinux-rpi.git iio: magnetometer: ak8974: add_device_randomness (serial number) Mix device-specific data into randomness pool. Signed-off-by: Michał Mirosław Reviewed-by: Linus Walleij Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index 76091da20a0c..b1c209faf1b1 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -470,6 +471,7 @@ static int ak8974_detect(struct ak8974 *ak8974) ret = ak8974_get_u16_val(ak8974, AMI305_SN, &sn); if (ret) return ret; + add_device_randomness(&sn, sizeof(sn)); dev_info(&ak8974->i2c->dev, "detected %s, FW ver %02x, S/N: %04x\n", name, fw, sn);