]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: adi-axi-adc: Slightly simplify axi_adc_create_platform_device()
authorNuno Sá <nuno.sa@analog.com>
Fri, 19 Dec 2025 15:40:39 +0000 (15:40 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 21 Dec 2025 11:42:52 +0000 (11:42 +0000)
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>
drivers/iio/adc/adi-axi-adc.c

index fef4fdedb9763e247daaa43f39021b89c5a0cf48..5f445e0de9eac7740c4b6b59eb0a00a0780e443d 100644 (file)
@@ -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 = {