From d4aeb6d6f2925676ba0d1fb26b60c26a3f2733ea Mon Sep 17 00:00:00 2001 From: yanyh2 Date: Tue, 8 Feb 2022 15:16:58 +0800 Subject: [PATCH] ignore optional dts property exist check result Don't return error if dts property is optional with default value specified to allow probe continue. Change-Id: I74e3d948b380fd90c09d96308d3bb2990e438574 Signed-off-by: yanyh2 Reviewed-on: https://gerrit.mot.com/2185351 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c b/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c index 848319cee9bd..183b138fba3e 100644 --- a/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c +++ b/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c @@ -2354,16 +2354,23 @@ static int bq_parse_dt(struct bq_fg_chip *bq) bq->name = bq->batt_name; rc = of_property_read_string(node, "mmi,batt-profile-name", &bq->batt_profile_name); - if (rc) + if (rc) { + mmi_fg_err(bq, "battery profile name is not specified in dts\n"); bq->batt_profile_name = NULL; + return rc; + } rc = of_property_read_u32(node, "design-capacity", &bq->batt_dc_conf); - if (rc < 0) - bq->batt_dc_conf = 0;; + if (rc < 0) { + bq->batt_dc_conf = 0; + rc = 0; + } rc = of_property_read_u32(node, "mmi,temp-source", &bq->temp_source); - if (rc < 0) + if (rc < 0) { bq->temp_source = TEMP_SOURCE_EXTERNAL; + rc = 0; + } return rc; }