summaryrefslogtreecommitdiff
path: root/drivers/power/supply
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2021-03-03 15:12:36 +0300
committerSebastian Reichel <sebastian.reichel@collabora.com>2021-03-15 03:07:54 +0300
commit17e499a7d6b52ff3be565a2f6184883dd1fdd9af (patch)
treef01aaddee48b25008fdeeb60b22c7a20102e98e2 /drivers/power/supply
parent32826341058bf8d63456289a8bf48648ad17c897 (diff)
downloadlinux-17e499a7d6b52ff3be565a2f6184883dd1fdd9af.tar.xz
power: supply: axp20x_usb_power: Add missing check in axp20x_usb_power_probe
There are two regmap_update_bits() calls but only one of them has return value check, which is odd. Add a return value check and terminate the execution flow on failure just like the other call. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply')
-rw-r--r--drivers/power/supply/axp20x_usb_power.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
index 8933ae26c3d6..7ed76eef8417 100644
--- a/drivers/power/supply/axp20x_usb_power.c
+++ b/drivers/power/supply/axp20x_usb_power.c
@@ -614,8 +614,10 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
if (power->axp20x_id == AXP813_ID) {
/* Enable USB Battery Charging specification detection */
- regmap_update_bits(axp20x->regmap, AXP288_BC_GLOBAL,
+ ret = regmap_update_bits(axp20x->regmap, AXP288_BC_GLOBAL,
AXP813_BC_EN, AXP813_BC_EN);
+ if (ret)
+ return ret;
}
psy_cfg.of_node = pdev->dev.of_node;