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

thermal/drivers/qcom-spmi-adc-tm5: 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>
Reviewed-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20240709-thermal-probe-v1-9-241644e2b6e0@linaro.orgSigned-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent d0b297e7
......@@ -829,12 +829,9 @@ static int adc_tm5_get_dt_channel_data(struct adc_tm5_chip *adc_tm,
channel->iio = devm_fwnode_iio_channel_get_by_name(adc_tm->dev,
of_fwnode_handle(node), NULL);
if (IS_ERR(channel->iio)) {
ret = PTR_ERR(channel->iio);
if (ret != -EPROBE_DEFER)
dev_err(dev, "%s: error getting channel: %d\n", name, ret);
return ret;
}
if (IS_ERR(channel->iio))
return dev_err_probe(dev, PTR_ERR(channel->iio), "%s: error getting channel\n",
name);
ret = of_property_read_u32_array(node, "qcom,pre-scaling", varr, 2);
if (!ret) {
......
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