From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Bjorn Andersson <andersson@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Guenter Roeck <linux@roeck-us.net>,
Josh Cartwright <joshc@codeaurora.org>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Doug Anderson <dianders@chromium.org>
Cc: linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] pinctrl: qcom: switch to devm_gpiochip_add_data()
Date: Mon, 5 May 2025 08:54:32 +0300 [thread overview]
Message-ID: <baea6673-b48d-4544-9c6b-5f64d8e76603@gmail.com> (raw)
In-Reply-To: <20250503-pinctrl-msm-fix-v1-3-da9b7f6408f4@oss.qualcomm.com>
On 03/05/2025 08:32, Dmitry Baryshkov wrote:
> In order to simplify cleanup actions, use devres-enabled version of
> gpiochip_add_data().
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> drivers/pinctrl/qcom/pinctrl-msm.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index 88dd462516c76d58b43d49accbddeea38af8f1ec..b2e8f7b3f3e3d5d232b2bd60e5cace62b21ffb03 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -1449,7 +1449,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
> girq->handler = handle_bad_irq;
> girq->parents[0] = pctrl->irq;
>
> - ret = gpiochip_add_data(&pctrl->chip, pctrl);
> + ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl);
> if (ret) {
> dev_err(pctrl->dev, "Failed register gpiochip\n");
> return ret;
> @@ -1470,7 +1470,6 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
> dev_name(pctrl->dev), 0, 0, chip->ngpio);
> if (ret) {
> dev_err(pctrl->dev, "Failed to add pin range\n");
> - gpiochip_remove(&pctrl->chip);
> return ret;
> }
> }
> @@ -1608,9 +1607,6 @@ EXPORT_SYMBOL(msm_pinctrl_probe);
>
> void msm_pinctrl_remove(struct platform_device *pdev)
> {
> - struct msm_pinctrl *pctrl = platform_get_drvdata(pdev);
> -
> - gpiochip_remove(&pctrl->chip);
> }
> EXPORT_SYMBOL(msm_pinctrl_remove);
I suppose this should also make the time window when the GPIO chip has
gone, but pinmux is still there (to call the 'gpiochip_line_is_valid()')
smaller.
FWIW:
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Yours,
-- Matti
next prev parent reply other threads:[~2025-05-05 5:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-03 5:32 [PATCH 0/4] pinctrl: qcom: several fixes for the pinctrl-msm code Dmitry Baryshkov
2025-05-03 5:32 ` [PATCH 1/4] pinctrl: qcom: don't crash on enabling GPIO HOG pins Dmitry Baryshkov
2025-05-05 5:49 ` Matti Vaittinen
2025-05-05 15:23 ` Doug Anderson
2025-05-06 17:28 ` Bartosz Golaszewski
2025-05-13 9:26 ` Linus Walleij
2025-05-13 15:07 ` Doug Anderson
2025-05-13 22:14 ` Linus Walleij
2025-05-03 5:32 ` [PATCH 2/4] pinctrl: qcom: switch to devm_register_sys_off_handler() Dmitry Baryshkov
2025-05-03 5:32 ` [PATCH 3/4] pinctrl: qcom: switch to devm_gpiochip_add_data() Dmitry Baryshkov
2025-05-05 5:54 ` Matti Vaittinen [this message]
2025-05-06 17:18 ` Bartosz Golaszewski
2025-05-06 17:23 ` Bartosz Golaszewski
2025-05-07 0:30 ` Dmitry Baryshkov
2025-05-03 5:32 ` [PATCH 4/4] pinctrl: qcom: drop msm_pinctrl_remove() Dmitry Baryshkov
2025-05-13 9:28 ` [PATCH 0/4] pinctrl: qcom: several fixes for the pinctrl-msm code Linus Walleij
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=baea6673-b48d-4544-9c6b-5f64d8e76603@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=joshc@codeaurora.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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