]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: ad7266: simplify error return
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Fri, 20 Feb 2026 13:18:46 +0000 (15:18 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 20:44:32 +0000 (20:44 +0000)
Return PTR_ERR() directly instead of assigning it to an intermediate
variable first.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7266.c

index 3364ac6c4631f57c5e23b5d20ac2bd062d6676da..0ef36c249ab80a8eeba6c69bf38a13bf96455480 100644 (file)
@@ -409,10 +409,8 @@ static int ad7266_probe(struct spi_device *spi)
                                st->gpios[i] = devm_gpiod_get(&spi->dev,
                                                      ad7266_gpio_labels[i],
                                                      GPIOD_OUT_LOW);
-                               if (IS_ERR(st->gpios[i])) {
-                                       ret = PTR_ERR(st->gpios[i]);
-                                       return ret;
-                               }
+                               if (IS_ERR(st->gpios[i]))
+                                       return PTR_ERR(st->gpios[i]);
                        }
                }
        } else {