Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit ecfee91

Browse files
krzkdlezcano
authored andcommitted
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>
1 parent d0b297e commit ecfee91

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/thermal/qcom/qcom-spmi-adc-tm5.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -829,12 +829,9 @@ static int adc_tm5_get_dt_channel_data(struct adc_tm5_chip *adc_tm,
829829

830830
channel->iio = devm_fwnode_iio_channel_get_by_name(adc_tm->dev,
831831
of_fwnode_handle(node), NULL);
832-
if (IS_ERR(channel->iio)) {
833-
ret = PTR_ERR(channel->iio);
834-
if (ret != -EPROBE_DEFER)
835-
dev_err(dev, "%s: error getting channel: %d\n", name, ret);
836-
return ret;
837-
}
832+
if (IS_ERR(channel->iio))
833+
return dev_err_probe(dev, PTR_ERR(channel->iio), "%s: error getting channel\n",
834+
name);
838835

839836
ret = of_property_read_u32_array(node, "qcom,pre-scaling", varr, 2);
840837
if (!ret) {

0 commit comments

Comments
 (0)