diff options
| author | Nuno Sá <nuno.sa@analog.com> | 2025-12-19 15:40:39 +0000 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2025-12-21 11:42:52 +0000 |
| commit | 0a272aaf5fc110a34f4a5aeb61db4b6d105c62e9 (patch) | |
| tree | 8e479d31a493df71eb4ea8cabb100a9d23e24a80 | |
| parent | 634a6316617e2ced7016b002d0b284a1502e9601 (diff) | |
iio: adc: adi-axi-adc: Slightly simplify axi_adc_create_platform_device()
There's no point in having a ret variable and checking for errors (as we
do nothing with it). Instead, save some lines of code and directly
return the devm_add_action_or_reset() call.
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| -rw-r--r-- | drivers/iio/adc/adi-axi-adc.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c index fef4fdedb976..5f445e0de9ea 100644 --- a/drivers/iio/adc/adi-axi-adc.c +++ b/drivers/iio/adc/adi-axi-adc.c @@ -591,17 +591,12 @@ static int axi_adc_create_platform_device(struct adi_axi_adc_state *st, .size_data = st->info->pdata_sz, }; struct platform_device *pdev; - int ret; pdev = platform_device_register_full(&pi); if (IS_ERR(pdev)) return PTR_ERR(pdev); - ret = devm_add_action_or_reset(st->dev, axi_adc_child_remove, pdev); - if (ret) - return ret; - - return 0; + return devm_add_action_or_reset(st->dev, axi_adc_child_remove, pdev); } static const struct iio_backend_ops adi_axi_adc_ops = { |
