diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-04-21 13:38:08 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-04-24 09:09:43 -0400 |
commit | f75d72309192e52ef9a3efb390b1c4f408c142df (patch) | |
tree | 7ba34fb0c598fca268d0db9e9f3c3585e62c565f /drivers/hwmon/ltc2945.c | |
parent | b2e5411ee26bff1deefd0b2c7beec9c133632e65 (diff) |
hwmon: (ltc2945) Don't crash the kernel unnecessarily
An implementation error should not crash the kernel if it is avoidable.
Replace BUG() with WARN_ONCE().
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/ltc2945.c')
-rw-r--r-- | drivers/hwmon/ltc2945.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/ltc2945.c b/drivers/hwmon/ltc2945.c index c104cc32989d..c9cddf5f056b 100644 --- a/drivers/hwmon/ltc2945.c +++ b/drivers/hwmon/ltc2945.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for Linear Technology LTC2945 I2C Power Monitor | 2 | * Driver for Linear Technology LTC2945 I2C Power Monitor |
3 | * | 3 | * |
4 | * Copyright (c) 2014 Guenter Roeck | 4 | * Copyright (c) 2014 Guenter Roeck |
@@ -314,8 +314,8 @@ static ssize_t ltc2945_reset_history(struct device *dev, | |||
314 | reg = LTC2945_MAX_ADIN_H; | 314 | reg = LTC2945_MAX_ADIN_H; |
315 | break; | 315 | break; |
316 | default: | 316 | default: |
317 | BUG(); | 317 | WARN_ONCE(1, "Bad register: 0x%x\n", reg); |
318 | break; | 318 | return -EINVAL; |
319 | } | 319 | } |
320 | /* Reset maximum */ | 320 | /* Reset maximum */ |
321 | ret = regmap_bulk_write(regmap, reg, buf_max, num_regs); | 321 | ret = regmap_bulk_write(regmap, reg, buf_max, num_regs); |