Skip to content

Commit

Permalink
hwmon: (ltc2945) Don't crash the kernel unnecessarily
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guenter Roeck committed Apr 24, 2014
1 parent b2e5411 commit f75d723
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/hwmon/ltc2945.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Driver for Linear Technology LTC2945 I2C Power Monitor
*
* Copyright (c) 2014 Guenter Roeck
Expand Down Expand Up @@ -314,8 +314,8 @@ static ssize_t ltc2945_reset_history(struct device *dev,
reg = LTC2945_MAX_ADIN_H;
break;
default:
BUG();
break;
WARN_ONCE(1, "Bad register: 0x%x\n", reg);
return -EINVAL;
}
/* Reset maximum */
ret = regmap_bulk_write(regmap, reg, buf_max, num_regs);
Expand Down

0 comments on commit f75d723

Please sign in to comment.