summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiyush Patle <piyushpatle228@gmail.com>2026-06-04 00:18:56 +0530
committerJonathan Cameron <jic23@kernel.org>2026-06-30 00:15:53 +0100
commitb74def999f929eb4d9fdf98a0d4f8ab5b8edeef2 (patch)
tree5de11a048537769a860196570233771ab6ba8c2a
parent44a6b355da1301534a20c0acf33f2d5ab9c4b916 (diff)
downloadlinux-stable-b74def999f929eb4d9fdf98a0d4f8ab5b8edeef2.tar.gz
linux-stable-b74def999f929eb4d9fdf98a0d4f8ab5b8edeef2.zip
iio: adc: hx711: split variable assignments in hx711_read and hx711_reset
Separate the initial value assignments from the declarations in hx711_read() and hx711_reset(). This is a small preparatory cleanup before the later loop-iterator and variant-specific changes adjust the local variable layout in these functions. No functional change. Signed-off-by: Piyush Patle <piyushpatle228@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/adc/hx711.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c
index 30e1ce321747..4ccb0bf2d71f 100644
--- a/drivers/iio/adc/hx711.c
+++ b/drivers/iio/adc/hx711.c
@@ -159,9 +159,10 @@ static int hx711_read(struct hx711_data *hx711_data, int trailing_pulses)
{
int i, ret;
int value = 0;
- int val = gpiod_get_value(hx711_data->gpiod_dout);
+ int val;
/* we double check if it's really down */
+ val = gpiod_get_value(hx711_data->gpiod_dout);
if (val)
return -EIO;
@@ -204,8 +205,9 @@ static int hx711_wait_for_ready(struct hx711_data *hx711_data)
static int hx711_reset(struct hx711_data *hx711_data)
{
- int val = hx711_wait_for_ready(hx711_data);
+ int val;
+ val = hx711_wait_for_ready(hx711_data);
if (val) {
/*
* an examination with the oszilloscope indicated