]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (pmbus) More stringent checking of VOUT_MODE register
authorGuenter Roeck <guenter.roeck@ericsson.com>
Tue, 1 Mar 2011 21:49:18 +0000 (13:49 -0800)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Tue, 15 Mar 2011 05:39:08 +0000 (22:39 -0700)
commit3caa1263fc4dc0894b5deeb023fc6ef0b29d916e
treefeeac423cf28ad6e5063f93620166a1954d1f4a6
parentf5f5f67f2188e7bb0a13caa8de9646ed4fe9d4b7
hwmon: (pmbus) More stringent checking of VOUT_MODE register

Some PMBus chips do not support the VOUT_MODE register. To make matters worse,
such chips may not return an error when reading the register either, but instead
return 0xff.

Check if the register exists using pmbus_check_byte_register() before reading
its value. In addition, validate the returned value and ignore it if it is 0xff
(which is invalid).

Reported-by: Greg Schnorr <gschnorr@cisco.com>
Tested-by: Greg Schnorr <gschnorr@cisco.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Greg Schnorr <gschnorr@cisco.com>
drivers/hwmon/pmbus_core.c