summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhash Jha <abhashkumarjha123@gmail.com>2024-09-28 21:41:08 +0530
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-10-05 12:09:15 +0100
commit41c1b5670c182cd09ce175d41c6f31b96c4adc78 (patch)
treed94db460e7cd21d90b65698e24d868cf32304a06
parent0b0c0049507e554865adb4289e2d1945736fe577 (diff)
iio: adc: mt6360-adc: Converted to use get_unaligned_be16()
Changed the manual shifting and adding of bytes to use get_unaligned_be16() api instead. Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com> Link: https://patch.msgid.link/20240928161108.163647-1-abhashkumarjha123@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/mt6360-adc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c
index e2ec805e834f..d09724414d07 100644
--- a/drivers/iio/adc/mt6360-adc.c
+++ b/drivers/iio/adc/mt6360-adc.c
@@ -124,7 +124,7 @@ static int mt6360_adc_read_channel(struct mt6360_adc_data *mad, int channel, int
usleep_range(ADC_LOOP_TIME_US / 2, ADC_LOOP_TIME_US);
}
- *val = rpt[1] << 8 | rpt[2];
+ *val = get_unaligned_be16(&rpt[1]);
ret = IIO_VAL_INT;
out_adc_conv: