summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2019-04-15 22:40:29 +0200
committerSebastian Reichel <sre@kernel.org>2019-04-15 22:40:29 +0200
commit6f76aa94e1d2f4e8758f65fd3ea08006303a1582 (patch)
tree462fac0be51ed72bcfdea28353b4e3bc9823324d /drivers/power
parentdf68c44c720ae6415cb1f0c0d9a2e9893f3b1765 (diff)
parentdbe7208c6c4aec083571f2ec742870a0d0edbea3 (diff)
downloadlinux-6f76aa94e1d2f4e8758f65fd3ea08006303a1582.tar.bz2
Merge branch 'psy-fixes' into psy-next
Merge fixes branch into next branch for cpcap-battery patches. Signed-off-by: Sebastian Reichel <sre@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/cpcap-battery.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
index 08d5037fd052..6887870ba32c 100644
--- a/drivers/power/supply/cpcap-battery.c
+++ b/drivers/power/supply/cpcap-battery.c
@@ -221,6 +221,9 @@ static int cpcap_battery_cc_raw_div(struct cpcap_battery_ddata *ddata,
int avg_current;
u32 cc_lsb;
+ if (!divider)
+ return 0;
+
sample &= 0xffffff; /* 24-bits, unsigned */
offset &= 0x7ff; /* 10-bits, signed */