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