Skip to content

Commit 70ee251

Browse files
Matthias Kaehlckedlezcano
authored andcommitted
thermal/drivers/qcom/spmi-adc-tm5: Don't abort probing if a sensor is not used
adc_tm5_register_tzd() registers the thermal zone sensors for all channels of the thermal monitor. If the registration of one channel fails the function skips the processing of the remaining channels and returns an error, which results in _probe() being aborted. One of the reasons the registration could fail is that none of the thermal zones is using the channel/sensor, which hardly is a critical error (if it is an error at all). If this case is detected emit a warning and continue with processing the remaining channels. Fixes: ca66dca ("thermal: qcom: add support for adc-tm5 PMIC thermal monitor") Signed-off-by: Matthias Kaehlcke <[email protected]> Reported-by: Stephen Boyd <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/20210823134726.1.I1dd23ddf77e5b3568625d80d6827653af071ce19@changeid
1 parent 5950fc4 commit 70ee251

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,12 @@ static int adc_tm5_register_tzd(struct adc_tm5_chip *adc_tm)
359359
&adc_tm->channels[i],
360360
&adc_tm5_ops);
361361
if (IS_ERR(tzd)) {
362+
if (PTR_ERR(tzd) == -ENODEV) {
363+
dev_warn(adc_tm->dev, "thermal sensor on channel %d is not used\n",
364+
adc_tm->channels[i].channel);
365+
continue;
366+
}
367+
362368
dev_err(adc_tm->dev, "Error registering TZ zone for channel %d: %ld\n",
363369
adc_tm->channels[i].channel, PTR_ERR(tzd));
364370
return PTR_ERR(tzd);

0 commit comments

Comments
 (0)