]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (ina2xx) bail-out from ina2xx_probe() in case of configuration errors
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 27 Nov 2014 09:59:06 +0000 (10:59 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 1 Dec 2014 04:13:14 +0000 (20:13 -0800)
commitfd36d4fda7ce1df02c4d10a58f86c62b84104c2d
tree0a2d4c292731e64ac425c6289bb957cae81fb15d
parent15e5c04db20abee39a549d6a94bfc0a5012e40bd
hwmon: (ina2xx) bail-out from ina2xx_probe() in case of configuration errors

The return value of i2c_smbus_write_word_swapped() isn't checked in
ina2xx_probe(). This leads to devices being registered even if they cannot
be physically detected (e.g. device is not powered-up at boot-time).

Even after restoring power to such device, it is left unconfigured as the
configuration has never been actually written to the register.

Error out in case of write errors in probe and notify the user.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
[Guenter Roeck: Fixed multi-line comment style]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ina2xx.c