diff options
author | Sebastian Reichel <sre@kernel.org> | 2019-04-15 22:40:29 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2019-04-15 22:40:29 +0200 |
commit | 6f76aa94e1d2f4e8758f65fd3ea08006303a1582 (patch) | |
tree | 462fac0be51ed72bcfdea28353b4e3bc9823324d /drivers/power | |
parent | df68c44c720ae6415cb1f0c0d9a2e9893f3b1765 (diff) | |
parent | dbe7208c6c4aec083571f2ec742870a0d0edbea3 (diff) | |
download | linux-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.c | 3 |
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 */ |