Re: [PATCH v3 3/5] thermal: rockchip: fixes invalid temperature case

From: Brian Norris
Date: Mon Nov 28 2016 - 13:48:05 EST


On Mon, Nov 28, 2016 at 07:12:02PM +0800, Caesar Wang wrote:
> The temp_to_code function will return 0 when we set the temperature to a
> invalid value (e.g. 61C, 62C, 63C....), that's unpractical. This patch
> will prevent this case happening. That will return the max analog value to
> indicate the temperature is invalid or over table temperature range.
>
> Signed-off-by: Caesar Wang <wxt@xxxxxxxxxxxxxx>
> ---
>
> Changes in v3:
> - fix trivial thing for error message nd return value.
>
> Changes in v2:
> - As Brian commnets that restructure this to pass error codes back to the
> upper layers.
> - Improve the commit message.
>
> Changes in v1: None
>
> drivers/thermal/rockchip_thermal.c | 48 ++++++++++++++++++++++----------------
> 1 file changed, 28 insertions(+), 20 deletions(-)

Looks better now.

Reviewed-by: Brian Norris <briannorris@xxxxxxxxxxxx>