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

Commit d5c38ee

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

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/thermal/thermal-generic-adc.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,8 @@ static int gadc_thermal_probe(struct platform_device *pdev)
131131
return -ENOMEM;
132132

133133
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");
140136

141137
ret = gadc_thermal_read_linear_lookup_table(dev, gti);
142138
if (ret < 0)

0 commit comments

Comments
 (0)