From: Andy Shevchenko Date: Tue, 21 Apr 2020 00:31:29 +0000 (+0300) Subject: iio: light: zopt2201: Use get_unaligned_le24() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d2fa63d2d155c366dfa9615b55ba7deb4bdb9489;p=linux.git iio: light: zopt2201: Use get_unaligned_le24() This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/light/zopt2201.c b/drivers/iio/light/zopt2201.c index 5f54f39e7a4c4..80ae530720cdb 100644 --- a/drivers/iio/light/zopt2201.c +++ b/drivers/iio/light/zopt2201.c @@ -19,6 +19,8 @@ #include #include +#include + #define ZOPT2201_DRV_NAME "zopt2201" /* Registers */ @@ -219,7 +221,7 @@ static int zopt2201_read(struct zopt2201_data *data, u8 reg) goto fail; mutex_unlock(&data->lock); - return (buf[2] << 16) | (buf[1] << 8) | buf[0]; + return get_unaligned_le24(&buf[0]); fail: mutex_unlock(&data->lock);