hwmon: (ina3221) Check channel status for alarms attribute read
authorNicolin Chen <nicoleotsuka@gmail.com>
Mon, 5 Nov 2018 20:48:40 +0000 (12:48 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 16 Dec 2018 23:13:11 +0000 (15:13 -0800)
commitefb0489ea8fa12c6a5b51c0b3e35f4f3d5d54939
tree6e7da4f369e6f637bc5ef29f3725fa3222cb67f3
parentdf04ced684d48f6ec5729ccd034702952160c6b3
hwmon: (ina3221) Check channel status for alarms attribute read

There is nothing critically wrong to read these two attributes
without having a is_enabled() check at this point. But reading
the MASK_ENABLE register would clear the CVRF bit according to
the datasheet. So it'd be safer to fence for disabled channels
in order to add pm runtime feature.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ina3221.c