power: supply: mm8013: Fix an error checking issue in mm8013_checkdevice()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 27 Sep 2023 12:41:05 +0000 (15:41 +0300)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sat, 30 Sep 2023 19:19:16 +0000 (21:19 +0200)
There is a missing "ret = " assignment so this checks the same "ret"
value twice.

Fixes: c75f4bf6800b ("power: supply: Introduce MM8013 fuel gauge driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/c46b4408-bf1d-408d-9e6b-16b0ad272532@moroto.mountain
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/mm8013.c

index 29fd65fe6545ae6be27a6515c37734ab38b8133d..caa272b035649c4352f8e04d739a12dd0c5ca486 100644 (file)
@@ -53,7 +53,7 @@ static int mm8013_checkdevice(struct mm8013_chip *chip)
        if (ret < 0)
                return ret;
 
-       regmap_read(chip->regmap, REG_BATID, &val);
+       ret = regmap_read(chip->regmap, REG_BATID, &val);
        if (ret < 0)
                return ret;