summaryrefslogtreecommitdiff
path: root/drivers/hwmon/pmbus
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-09-13 21:31:38 +0400
committerGuenter Roeck <linux@roeck-us.net>2013-10-14 03:16:26 +0400
commitaf78fdf4a61827bed7f0fcbba8cc9ae393a3ad82 (patch)
treef3a5e81d9e3b1d1ca063184d79209d5d51d0ac37 /drivers/hwmon/pmbus
parentae02e7418ffa2ba5d927869ef9eab4c87549d8e9 (diff)
downloadlinux-af78fdf4a61827bed7f0fcbba8cc9ae393a3ad82.tar.xz
hwmon: (pmbus) Don't unnecessarily crash the kernel
pmbus code currently crashes the kernel if it detects an internal implementation error. While the detected condition suggests that there is a bug in the code, it is hardly fatal. Therefore, it should not trigger a crash. Replace BUG() with WARN(). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pmbus')
-rw-r--r--drivers/hwmon/pmbus/pmbus_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 9319fcf142d9..871cf64d2996 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -686,7 +686,7 @@ static int pmbus_get_boolean(struct pmbus_data *data, struct pmbus_boolean *b,
if (!s1 && !s2) {
ret = !!regval;
} else if (!s1 || !s2) {
- BUG();
+ WARN(1, "Bad boolean descriptor %p: s1=%p, s2=%p\n", b, s1, s2);
return 0;
} else {
long v1, v2;