[PATCH v5 10/11] iio: adc: hx711: split hx711_reset variable assignment

Piyush Patle
2026-04-29T05:46:37Z

Separate the hx711_wait_for_ready() assignment from the declaration in
hx711_reset().

This is a small preparatory cleanup before the later variant-specific
changes add another local variable in the same function.

No functional change.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
---
Changes in v5:
- New preparatory patch requested during review.
- Split the hx711_wait_for_ready() assignment from the declaration
before the later HX710B change adds another local variable in
hx711_reset().
- Keep this separate specifically because Andy Shevchenko asked for the
prep split rather than mixing it into the HX710B feature patch.
---
drivers/iio/adc/hx711.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c
index 914c6efd0f96..e72f3c2cdbcf 100644
--- a/drivers/iio/adc/hx711.c
+++ b/drivers/iio/adc/hx711.c
@@ -204,7 +204,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) {
/*
--
2.43.0