Skip to content

Commit 5d8db38

Browse files
Yang Yingliangdlezcano
authored andcommitted
thermal/drivers/qcom: Fix error code in adc_tm5_get_dt_channel_data()
Return -EINVAL when args is invalid instead of 'ret' which is set to zero by a previous successful call to a function. Fixes: ca66dca ("thermal: qcom: add support for adc-tm5 PMIC thermal monitor") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8d84733 commit 5d8db38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static int adc_tm5_get_dt_channel_data(struct adc_tm5_chip *adc_tm,
441441

442442
if (args.args_count != 1 || args.args[0] >= ADC5_MAX_CHANNEL) {
443443
dev_err(dev, "%s: invalid ADC channel number %d\n", name, chan);
444-
return ret;
444+
return -EINVAL;
445445
}
446446
channel->adc_channel = args.args[0];
447447

0 commit comments

Comments
 (0)