Re: [PATCH 1/2] Clear sensor data after chip write
From: Guenter Roeck
Date: Mon Feb 01 2021 - 19:25:57 EST
On Mon, Feb 01, 2021 at 08:59:28PM +0100, Erik Rosen wrote:
> Set the sensor->data field to -ENODATA to force a chip access next time
> the sensor value is read.
>
> Signed-off-by: Erik Rosen <erik.rosen@xxxxxxxxxxxxx>
Applied. Please remember to add subsystem and driver to future patches.
In this case, I added:
hwmon: (pmbus) ...
Thanks,
Guenter
> ---
> drivers/hwmon/pmbus/pmbus_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
> index 192442b3b7a2..e27f23eee1e3 100644
> --- a/drivers/hwmon/pmbus/pmbus_core.c
> +++ b/drivers/hwmon/pmbus/pmbus_core.c
> @@ -974,7 +974,7 @@ static ssize_t pmbus_set_sensor(struct device *dev,
> if (ret < 0)
> rv = ret;
> else
> - sensor->data = regval;
> + sensor->data = -ENODATA;
> mutex_unlock(&data->update_lock);
> return rv;
> }