ASoC: wsa881x: Update temperature value during device down

when wsa881x device is down, reading temperature from driver
returns error. Instead of propagating the error, return the
cached temperature value to the thermal framework to avoid
iterative calls to read the temperature that results in
excessive logging.

Change-Id: I529c83eafec63004c2469bf16a0b53bd5accbdbb
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Цей коміт міститься в:
Sudheer Papothi
2018-08-18 05:02:58 +05:30
джерело b94000b1af
коміт 4b9d12f1e9

Переглянути файл

@@ -80,9 +80,11 @@ temp_retry:
if (pdata->wsa_temp_reg_read) { if (pdata->wsa_temp_reg_read) {
ret = pdata->wsa_temp_reg_read(codec, &reg); ret = pdata->wsa_temp_reg_read(codec, &reg);
if (ret) { if (ret) {
pr_err("%s: temperature register read failed: %d\n", pr_err("%s: temp read failed: %d, current temp: %d\n",
__func__, ret); __func__, ret, pdata->curr_temp);
return ret; if (temp)
*temp = pdata->curr_temp;
return 0;
} }
} else { } else {
pr_err("%s: wsa_temp_reg_read is NULL\n", __func__); pr_err("%s: wsa_temp_reg_read is NULL\n", __func__);