hwmon: (pmbus) Fix vout margin caching
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Tue, 16 Aug 2022 14:44:14 +0000 (16:44 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 17 Aug 2022 15:32:09 +0000 (08:32 -0700)
commited3590561f5d3343a1717396307d0942eda472ed
treec28cb4473fa229a51fc7fc2fb1a64b02b49b273a
parent09e52d17b72d3a4bf6951a90ccd8c97fae04e5cf
hwmon: (pmbus) Fix vout margin caching

The code currently uses a zero margin to mean not cached, but this
results in the cache being bypassed if the (low) margin is set to zero,
leading to lots of unnecessary SMBus transactions in that case.  Use a
negative value instead.

Fixes: 07fb76273db89d93 ("hwmon: (pmbus) Introduce and use cached vout margins")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20220816144414.2358974-1-vincent.whitchurch@axis.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c