mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 12:52:29 -04:00
iio: adc: aspeed: 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> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
e358215e0a
commit
dcc3ac29f4
@@ -535,11 +535,10 @@ static int aspeed_adc_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(data->clk_scaler);
|
||||
|
||||
data->rst = devm_reset_control_get_shared(&pdev->dev, NULL);
|
||||
if (IS_ERR(data->rst)) {
|
||||
dev_err(&pdev->dev,
|
||||
"invalid or missing reset controller device tree entry");
|
||||
return PTR_ERR(data->rst);
|
||||
}
|
||||
if (IS_ERR(data->rst))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(data->rst),
|
||||
"invalid or missing reset controller device tree entry");
|
||||
|
||||
reset_control_deassert(data->rst);
|
||||
|
||||
ret = devm_add_action_or_reset(data->dev, aspeed_adc_reset_assert,
|
||||
|
||||
Reference in New Issue
Block a user