summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-09-13 19:31:38 +0200
committerGuenter Roeck <linux@roeck-us.net>2013-10-14 01:16:26 +0200
commitaf78fdf4a61827bed7f0fcbba8cc9ae393a3ad82 (patch)
treef3a5e81d9e3b1d1ca063184d79209d5d51d0ac37 /drivers/hwmon/pmbus
parenthwmon: (mc13783-adc) Increase size of name string (diff)
downloadlinux-af78fdf4a61827bed7f0fcbba8cc9ae393a3ad82.tar.xz
linux-af78fdf4a61827bed7f0fcbba8cc9ae393a3ad82.zip
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;