Commit d5c38eec authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Daniel Lezcano

thermal/drivers/generic-adc: Simplify with dev_err_probe()

Error handling in probe() can be a bit simpler with dev_err_probe().
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240709-thermal-probe-v1-12-241644e2b6e0@linaro.orgSigned-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent f637bfe2
...@@ -131,12 +131,8 @@ static int gadc_thermal_probe(struct platform_device *pdev) ...@@ -131,12 +131,8 @@ static int gadc_thermal_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
gti->channel = devm_iio_channel_get(dev, "sensor-channel"); gti->channel = devm_iio_channel_get(dev, "sensor-channel");
if (IS_ERR(gti->channel)) { if (IS_ERR(gti->channel))
ret = PTR_ERR(gti->channel); return dev_err_probe(dev, PTR_ERR(gti->channel), "IIO channel not found\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "IIO channel not found: %d\n", ret);
return ret;
}
ret = gadc_thermal_read_linear_lookup_table(dev, gti); ret = gadc_thermal_read_linear_lookup_table(dev, gti);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment