From 1904ea8aeb0219500297d898fabd6e0f291b7d4f Mon Sep 17 00:00:00 2001 From: Lei Chen Date: Mon, 16 Oct 2023 20:09:33 +0800 Subject: [PATCH] charger:fix sgm4154x ID detected incorrect issue After qcom rebase qc/Divar.LA.2.1.1-00014-STD.PROD-1, sgm4154x was always found even if there is no sgm4154x hardware IC. Need return if read sgm4154x ID failed. Change-Id: I08c39cb60de00addc32faee1ae945adb0cfc7053 Signed-off-by: Lei Chen Reviewed-on: https://gerrit.mot.com/2768596 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wei Xu Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c index 08bb00586a42..9d8911ff4c09 100644 --- a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c +++ b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c @@ -3517,6 +3517,10 @@ static int sgm4154x_probe(struct i2c_client *client, i2c_set_clientdata(client, sgm); ret = sgm4154x_hw_chipid_detect(sgm); + if (ret < 0) { + pr_info("[%s] device not found, ret = %d!!!\n", __func__, ret); + return ret; + } #ifdef __SGM41513_CHIP_ID__ if ((ret & SGM4154x_PN_MASK) != SGM4154x_PN_41513_ID){