Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (f75375s) Don't crash the kernel unnecessarily

The f75375s driver crashes the kernel if it detects an an internal
implementation error. While the detected conditions suggest that
there is a bug in the code, the condition is not fatal.
Replace BUG() with WARN().

Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

+2 -2
+2 -2
drivers/hwmon/f75375s.c
··· 275 275 case 3: /* Manual, speed mode */ 276 276 return false; 277 277 default: 278 - BUG(); 278 + WARN(1, "Unexpected pwm_enable value %d\n", pwm_enable); 279 279 return true; 280 280 } 281 281 } ··· 291 291 case 4: /* Auto, duty mode */ 292 292 return true; 293 293 default: 294 - BUG(); 294 + WARN(1, "Unexpected pwm_enable value %d\n", pwm_enable); 295 295 return false; 296 296 } 297 297 }