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>
.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 = {