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 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2185351
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
yanyh2 2022-02-08 15:16:58 +08:00 • committed by Yonghua Yan
commit d4aeb6d6f2

View file

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