Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240709-thermal-probe-v1-12-241644e2b6e0@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

authored by

Krzysztof Kozlowski and committed by
Daniel Lezcano
d5c38eec f637bfe2

+2 -6
+2 -6
drivers/thermal/thermal-generic-adc.c
··· 131 131 return -ENOMEM; 132 132 133 133 gti->channel = devm_iio_channel_get(dev, "sensor-channel"); 134 - if (IS_ERR(gti->channel)) { 135 - ret = PTR_ERR(gti->channel); 136 - if (ret != -EPROBE_DEFER) 137 - dev_err(dev, "IIO channel not found: %d\n", ret); 138 - return ret; 139 - } 134 + if (IS_ERR(gti->channel)) 135 + return dev_err_probe(dev, PTR_ERR(gti->channel), "IIO channel not found\n"); 140 136 141 137 ret = gadc_thermal_read_linear_lookup_table(dev, gti); 142 138 if (ret < 0)