mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 10:31:33 -04:00
iio: adc: rockchip: Simplify with dev_err_probe
Use dev_err_probe() to make error code handling simpler and handle deferred probe nicely (avoid spamming logs). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
f8831384dc
commit
df2a034aef
@@ -492,10 +492,9 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
|
||||
*/
|
||||
info->reset = devm_reset_control_get_optional_exclusive(&pdev->dev,
|
||||
"saradc-apb");
|
||||
if (IS_ERR(info->reset)) {
|
||||
ret = PTR_ERR(info->reset);
|
||||
return dev_err_probe(&pdev->dev, ret, "failed to get saradc-apb\n");
|
||||
}
|
||||
if (IS_ERR(info->reset))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(info->reset),
|
||||
"failed to get saradc-apb\n");
|
||||
|
||||
init_completion(&info->completion);
|
||||
|
||||
@@ -505,10 +504,8 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
|
||||
|
||||
ret = devm_request_irq(&pdev->dev, irq, rockchip_saradc_isr,
|
||||
0, dev_name(&pdev->dev), info);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "failed requesting irq %d\n", irq);
|
||||
return ret;
|
||||
}
|
||||
if (ret < 0)
|
||||
return dev_err_probe(&pdev->dev, ret, "failed requesting irq %d\n", irq);
|
||||
|
||||
info->vref = devm_regulator_get(&pdev->dev, "vref");
|
||||
if (IS_ERR(info->vref))
|
||||
|
||||
Reference in New Issue
Block a user