From e9dcdc46e0f0d2852738020dfc33c3156dff98ec Mon Sep 17 00:00:00 2001 From: Yonghua Yan Date: Thu, 19 May 2022 18:04:53 +0800 Subject: [PATCH] Check return of regulator_enable Check return of regulator_enable to avoid compile issue for in some build environment. Change-Id: I49e64662959c2f5e57909901ae3c373ae57b3e08 Signed-off-by: Yonghua Yan Reviewed-on: https://gerrit.mot.com/2273786 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c b/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c index 5f84d6a3264a..d1f4f9a0321e 100644 --- a/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c +++ b/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c @@ -1024,9 +1024,10 @@ static int cw2217_probe(struct i2c_client *client, const struct i2c_device_id *i if (IS_ERR_OR_NULL(cw_bat->vdd_i2c_vreg)) { printk("%s: Could not get vdd-i2c power regulator\n", __func__); cw_bat->vdd_i2c_vreg = NULL; - ret = 0; } else { - regulator_enable(cw_bat->vdd_i2c_vreg); + ret = regulator_enable(cw_bat->vdd_i2c_vreg); + printk("%s: Enable vdd-i2c, ret=%d\n", __func__, ret); + ret = 0; } ret = cw_get_chip_id(cw_bat);