From 5cf523287da2e7dfb116b314c12eaeca3904bae2 Mon Sep 17 00:00:00 2001 From: wutao Date: Sun, 14 Nov 2021 14:46:11 +0800 Subject: [PATCH] mmi_qc3p_wt6670f: fix wt6670f driver bug modify wt6670f_i2c_probe code,if gpio_request failed go to gpio_direction_output while dump.So add return before gpio_direction_output. Change-Id: Ia61ec64165a8754a948474ff848b07eaf79968c6 Signed-off-by: wutao Reviewed-on: https://gerrit.mot.com/2115729 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- drivers/power/mmi_qc3p_wt6670f/wt6670f_qc3p.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/mmi_qc3p_wt6670f/wt6670f_qc3p.c b/drivers/power/mmi_qc3p_wt6670f/wt6670f_qc3p.c index c73637f716f7..dda42751b29a 100644 --- a/drivers/power/mmi_qc3p_wt6670f/wt6670f_qc3p.c +++ b/drivers/power/mmi_qc3p_wt6670f/wt6670f_qc3p.c @@ -462,8 +462,10 @@ static int wt6670f_i2c_probe(struct i2c_client *client, pr_info("[%s] of get wt6670 gpio failed, reset_pin:%d\n", __func__, wt->reset_pin); - if (gpio_request(wt->reset_pin, "wt6670_reset_pin")) + if (gpio_request(wt->reset_pin, "wt6670_reset_pin")) { pr_info("[%s] gpio_request reset failed", __func__); + return 0; + } if (gpio_direction_output(wt->reset_pin, 0)) pr_info("[%s] gpio_direction_output failed", __func__);