power: supply: cpcap-battery: Fix division by zero
[ Upstream commit dbe7208c6c4aec083571f2ec742870a0d0edbea3 ] If called fast enough so samples do not increment, we can get division by zero in kernel: __div0 cpcap_battery_cc_raw_div cpcap_battery_get_property power_supply_get_property.part.1 power_supply_get_property power_supply_show_property power_supply_uevent Fixes: 874b2adb ("power: supply: cpcap-battery: Add a battery driver") Signed-off-by: NTony Lindgren <tony@atomide.com> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: NSasha Levin <sashal@kernel.org>
Showing
想要评论请 注册 或 登录