From: Abhash Jha <abhashkumarjha123@gmail.com>
To: linux-iio@vger.kernel.org
Cc: angelogioacchino.delregno@collabora.com, matthias.bgg@gmail.com,
jic23@kernel.org, lars@metafoo.de, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Abhash Jha <abhashkumarjha123@gmail.com>
Subject: [PATCH] iio: adc: mt6360-adc: Converted to use get_unaligned_be16()
Date: Sat, 28 Sep 2024 21:41:08 +0530 [thread overview]
Message-ID: <20240928161108.163647-1-abhashkumarjha123@gmail.com> (raw)
Changed the manual shifting and adding of bytes to use
get_unaligned_be16() api instead.
Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
---
drivers/iio/adc/mt6360-adc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c
index 3710473e5..91befe2cd 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:
--
2.43.0
next reply other threads:[~2024-09-28 16:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-28 16:11 Abhash Jha [this message]
2024-09-29 16:48 ` [PATCH] iio: adc: mt6360-adc: Converted to use get_unaligned_be16() Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240928161108.163647-1-abhashkumarjha123@gmail.com \
--to=abhashkumarjha123@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox