From: Lorenzo Bianconi Date: Mon, 8 Jan 2018 22:12:31 +0000 (+0100) Subject: iio: humidity: hts221: remove unnecessary get_unaligned_le16() X-Git-Tag: v4.17-rc1~124^2~388^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=56154dac338a96c37713b2320d57b76d624a245c;p=thirdparty%2Fkernel%2Flinux.git iio: humidity: hts221: remove unnecessary get_unaligned_le16() Remove unnecessary unaligned access routine in hts221_read_oneshot() and the related include Signed-off-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/humidity/hts221_core.c b/drivers/iio/humidity/hts221_core.c index fb74a22ef3f58..166946d4978d8 100644 --- a/drivers/iio/humidity/hts221_core.c +++ b/drivers/iio/humidity/hts221_core.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -406,7 +405,7 @@ static int hts221_get_sensor_offset(struct hts221_hw *hw, static int hts221_read_oneshot(struct hts221_hw *hw, u8 addr, int *val) { - u8 data[HTS221_DATA_SIZE]; + __le16 data; int err; err = hts221_set_enable(hw, true); @@ -415,13 +414,13 @@ static int hts221_read_oneshot(struct hts221_hw *hw, u8 addr, int *val) msleep(50); - err = regmap_bulk_read(hw->regmap, addr, data, sizeof(data)); + err = regmap_bulk_read(hw->regmap, addr, &data, sizeof(data)); if (err < 0) return err; hts221_set_enable(hw, false); - *val = (s16)get_unaligned_le16(data); + *val = (s16)le16_to_cpu(data); return IIO_VAL_INT; }