staging:iio:ad7476: Use be16_to_cpup instead of open-coding it
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 10 Sep 2012 08:34:00 +0000 (09:34 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 15 Sep 2012 09:02:14 +0000 (10:02 +0100)
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/adc/ad7476.c

index 12e6e4b36a5ff4c1c298ddb8deb8127a740f07e3..a33a4066ebe256ee1803f1832758ad4ded4de6da 100644 (file)
@@ -83,7 +83,7 @@ static int ad7476_scan_direct(struct ad7476_state *st)
        if (ret)
                return ret;
 
-       return (st->data[0] << 8) | st->data[1];
+       return be16_to_cpup((__be16 *)st->data);
 }
 
 static int ad7476_read_raw(struct iio_dev *indio_dev,