From: ChiYuan Huang <cy_huang@richtek.com>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: <linux-pm@vger.kernel.org>, <sre@kernel.org>, <alina_yu@richtek.com>
Subject: Re: [PATCH -next] power: supply: rt9471: fix using wrong ce_gpio in rt9471_probe()
Date: Mon, 6 Feb 2023 16:59:46 +0800 [thread overview]
Message-ID: <20230206085946.GA3174@linuxcarl2.richtek.com> (raw)
In-Reply-To: <20230206082025.1992331-1-yangyingliang@huawei.com>
On Mon, Feb 06, 2023 at 04:20:25PM +0800, Yang Yingliang wrote:
Hi, YingLiang:
Many thanks for the fix.
My original thought is to remove ce_gpio in chip data and make it
all by SW control only, not to control by HW pin.
Could you help to send v2 patch to remove 'ce_gpio' in chip data?
And for the macro IS_ERR(chip->ce_gpio), just change to IS_ERR(ce_gpio).
In patch v2, you can add my Reviewed-by tag.
Reviewed-by: ChiYuan Huang <cy_huang@richtek.com>
Thanks.
> Pass the correct 'ce_gpio' to IS_ERR(), and assign it to
> the 'chip->ce_gpio', if devm_gpiod_get_optional() succeed.
>
> Fixes: 4a1a5f6781d8 ("power: supply: rt9471: Add Richtek RT9471 charger driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/power/supply/rt9471.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/rt9471.c b/drivers/power/supply/rt9471.c
> index 5d3cf375ad5c..de0bf484d313 100644
> --- a/drivers/power/supply/rt9471.c
> +++ b/drivers/power/supply/rt9471.c
> @@ -851,10 +851,12 @@ static int rt9471_probe(struct i2c_client *i2c)
>
> /* Default pull charge enable gpio to make 'CHG_EN' by SW control only */
> ce_gpio = devm_gpiod_get_optional(dev, "charge-enable", GPIOD_OUT_HIGH);
> - if (IS_ERR(chip->ce_gpio))
> + if (IS_ERR(ce_gpio))
> return dev_err_probe(dev, PTR_ERR(ce_gpio),
> "Failed to config charge enable gpio\n");
>
> + chip->ce_gpio = ce_gpio;
> +
> regmap = devm_regmap_init_i2c(i2c, &rt9471_regmap_config);
> if (IS_ERR(regmap))
> return dev_err_probe(dev, PTR_ERR(regmap), "Failed to init regmap\n");
> --
> 2.25.1
>
next prev parent reply other threads:[~2023-02-06 8:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 8:20 [PATCH -next] power: supply: rt9471: fix using wrong ce_gpio in rt9471_probe() Yang Yingliang
2023-02-06 8:59 ` ChiYuan Huang [this message]
2023-02-06 9:13 ` ChiYuan Huang
2023-02-06 11:47 ` Yang Yingliang
2023-02-06 11:58 ` ChiYuan Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230206085946.GA3174@linuxcarl2.richtek.com \
--to=cy_huang@richtek.com \
--cc=alina_yu@richtek.com \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.org \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox