mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
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>
This commit is contained in:
parent
634a631661
commit
0a272aaf5f
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user