Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Krzysztof Kozlowski and committed by
Jonathan Cameron
df2a034a f8831384

+5 -8
+5 -8
drivers/iio/adc/rockchip_saradc.c
··· 492 492 */ 493 493 info->reset = devm_reset_control_get_optional_exclusive(&pdev->dev, 494 494 "saradc-apb"); 495 - if (IS_ERR(info->reset)) { 496 - ret = PTR_ERR(info->reset); 497 - return dev_err_probe(&pdev->dev, ret, "failed to get saradc-apb\n"); 498 - } 495 + if (IS_ERR(info->reset)) 496 + return dev_err_probe(&pdev->dev, PTR_ERR(info->reset), 497 + "failed to get saradc-apb\n"); 499 498 500 499 init_completion(&info->completion); 501 500 ··· 504 505 505 506 ret = devm_request_irq(&pdev->dev, irq, rockchip_saradc_isr, 506 507 0, dev_name(&pdev->dev), info); 507 - if (ret < 0) { 508 - dev_err(&pdev->dev, "failed requesting irq %d\n", irq); 509 - return ret; 510 - } 508 + if (ret < 0) 509 + return dev_err_probe(&pdev->dev, ret, "failed requesting irq %d\n", irq); 511 510 512 511 info->vref = devm_regulator_get(&pdev->dev, "vref"); 513 512 if (IS_ERR(info->vref))