summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAntoniu Miclaus <antoniu.miclaus@analog.com>2026-02-20 16:18:46 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2026-02-23 23:44:32 +0300
commitb40be056eefe458698d75ff2b78ed853efdf5e8a (patch)
tree0c4ab5e4fc4d10448b05fbfe7d2676f2a864d8fe /drivers
parent3d8fedcc62b663f6c04b1d172e7298c71bbddb8f (diff)
downloadlinux-b40be056eefe458698d75ff2b78ed853efdf5e8a.tar.xz
iio: adc: ad7266: simplify error return
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/adc/ad7266.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c
index 3364ac6c4631..0ef36c249ab8 100644
--- a/drivers/iio/adc/ad7266.c
+++ b/drivers/iio/adc/ad7266.c
@@ -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 {