diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2024-07-09 15:59:39 +0300 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2024-07-15 14:31:41 +0300 |
commit | ecfee9176b8fd68178a9682fc7285054266012ef (patch) | |
tree | 5ad2589aa1832b57a5d67fb0d2df356cc03e2ffd | |
parent | d0b297e76b5cb06bd67577dc1b710cc13e4f4300 (diff) | |
download | linux-ecfee9176b8fd68178a9682fc7285054266012ef.tar.xz |
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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20240709-thermal-probe-v1-9-241644e2b6e0@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r-- | drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c index 756ac6842ff9..7c9f4023babc 100644 --- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c +++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c @@ -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) { |