]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit56276135abf164c5a0f7e42906bf971816c688de
treec28cb4473fa229a51fc7fc2fb1a64b02b49b273a
parentf4bc86d80f3e9f38f37e3e9bcf1e0c3997cdb1f4
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: cc13c59f15428d0b ("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