From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Guenter Roeck <linux@roeck-us.net>,
Josh Cartwright <joshc@codeaurora.org>,
Matti Vaittinen <mazziesaccount@gmail.com>,
Doug Anderson <dianders@chromium.org>,
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: Tue, 6 May 2025 19:18:15 +0200 [thread overview]
Message-ID: <CACMJSesbNz1Q5S4EDDk_O+oUfw8c6MQdovUAA_q2EZzuG2+i4Q@mail.gmail.com> (raw)
In-Reply-To: <20250503-pinctrl-msm-fix-v1-3-da9b7f6408f4@oss.qualcomm.com>
On Sat, 3 May 2025 at 07:32, Dmitry Baryshkov
<dmitry.baryshkov@oss.qualcomm.com> 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);
>
>
> --
> 2.39.5
>
If you're at it then why not remove this function here and the
callback assignment throughout the pinctrl/qcom/ directory?
Bart
next prev parent reply other threads:[~2025-05-06 17:18 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
2025-05-06 17:18 ` Bartosz Golaszewski [this message]
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=CACMJSesbNz1Q5S4EDDk_O+oUfw8c6MQdovUAA_q2EZzuG2+i4Q@mail.gmail.com \
--to=bartosz.golaszewski@linaro.org \
--cc=andersson@kernel.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 \
--cc=mazziesaccount@gmail.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;
as well as URLs for NNTP newsgroup(s).