hwmon: (bt1-pvt) Cache current update timeout
authorSerge Semin <Sergey.Semin@baikalelectronics.ru>
Sun, 20 Sep 2020 11:09:22 +0000 (14:09 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 4 Oct 2020 15:40:10 +0000 (08:40 -0700)
commit0015503e5f6357f286bef34d039e43359fa4efd4
treea6010dff1277164e4b490f6a69701217a9e83d3f
parenta6db1561291fc0f2f9aa23bf38f381adc63e7b14
hwmon: (bt1-pvt) Cache current update timeout

Instead of converting the update timeout data to the milliseconds each
time on the read procedure let's preserve the currently set timeout in the
dedicated driver private data cache. The cached value will be then used in
the timeout read method and in the alarm-less data conversion to prevent
the caller task hanging up in case if the PVT sensor is suddenly powered
down.

Fixes: 87976ce2825d ("hwmon: Add Baikal-T1 PVT sensor driver")
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20200920110924.19741-3-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/bt1-pvt.c
drivers/hwmon/bt1-pvt.h