[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200904164048.GA74175@roeck-us.net>
Date: Fri, 4 Sep 2020 09:40:48 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Lars Povlsen <lars.povlsen@...rochip.com>
Cc: Jean Delvare <jdelvare@...e.com>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
linux-hwmon@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmon: sparx5: Fix initial reading of temperature
On Thu, Sep 03, 2020 at 03:47:04PM +0200, Lars Povlsen wrote:
> If the temperature is read before the internal calibration is
> completed, the driver returns -EIO. Instead it should return -EAGAIN
> to encourage repeating the operation.
>
> Signed-off-by: Lars Povlsen <lars.povlsen@...rochip.com>
Applied. I added a note stating that I would prefer -ENODATA, and why,
but that this is not feasible due to thermal subsystem requirements.
Thanks,
Guenter
> ---
> drivers/hwmon/sparx5-temp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --
> 2.27.0
>
> diff --git a/drivers/hwmon/sparx5-temp.c b/drivers/hwmon/sparx5-temp.c
> index 1a2b1026b026..98be48e3a22a 100644
> --- a/drivers/hwmon/sparx5-temp.c
> +++ b/drivers/hwmon/sparx5-temp.c
> @@ -56,7 +56,7 @@ static int s5_read(struct device *dev, enum hwmon_sensor_types type,
> case hwmon_temp_input:
> stat = readl_relaxed(hwmon->base + TEMP_STAT);
> if (!(stat & TEMP_STAT_VALID))
> - return -EIO;
> + return -EAGAIN;
> value = stat & TEMP_STAT_TEMP;
> /*
> * From register documentation:
Powered by blists - more mailing lists