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 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2273786
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Yonghua Yan 2022-05-19 18:04:53 +08:00
commit e9dcdc46e0

View file

@ -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);