Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f75d7230 authored by Guenter Roeck's avatar Guenter Roeck
Browse files

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: default avatarGuenter Roeck <linux@roeck-us.net>
parent b2e5411e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);