All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v1 1/1] pinctrl: st: Avoid using of_node member of struct gpio_chip
Date: Sun, 9 Oct 2022 23:13:44 -0700	[thread overview]
Message-ID: <Y0O4GNR28kSOR1Iu@google.com> (raw)
In-Reply-To: <20221004125449.67679-1-andriy.shevchenko@linux.intel.com>

Hi Andy,

On Tue, Oct 04, 2022 at 03:54:49PM +0300, Andy Shevchenko wrote:
> The of_node member of the struct gpio_chip is obsoleted and
> shouldn't be used. It will be removed in the future.
> 
> Replace its use in st_pctl_dt_calculate_pin() by comparing
> the fwnode pointers.
> 
> Fixes: e75729b2f63f ("pinctrl: st: stop abusing of_get_named_gpio()")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/pinctrl/pinctrl-st.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index cf7f9cbe6044..ac24d07338a4 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -1175,7 +1175,7 @@ static int st_pctl_dt_calculate_pin(struct st_pinctrl *info,
>  
>  	for (i = 0; i < info->nbanks; i++) {
>  		chip = &info->banks[i].gpio_chip;
> -		if (chip->of_node == np) {
> +		if (chip->fwnode == of_fwnode_handle(np)) {

Are you sure chip's fwnode is properly set here (without your other
patch)? I don't believe the driver sets it up, and I don't think gpiolib
maps it from the gpio_chip->of_node.

Actually, there is another reference to of_node in gpio chip in
st_gpiolib_register_bank()...

Thanks.

-- 
Dmitry

WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v1 1/1] pinctrl: st: Avoid using of_node member of struct gpio_chip
Date: Sun, 9 Oct 2022 23:13:44 -0700	[thread overview]
Message-ID: <Y0O4GNR28kSOR1Iu@google.com> (raw)
In-Reply-To: <20221004125449.67679-1-andriy.shevchenko@linux.intel.com>

Hi Andy,

On Tue, Oct 04, 2022 at 03:54:49PM +0300, Andy Shevchenko wrote:
> The of_node member of the struct gpio_chip is obsoleted and
> shouldn't be used. It will be removed in the future.
> 
> Replace its use in st_pctl_dt_calculate_pin() by comparing
> the fwnode pointers.
> 
> Fixes: e75729b2f63f ("pinctrl: st: stop abusing of_get_named_gpio()")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/pinctrl/pinctrl-st.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index cf7f9cbe6044..ac24d07338a4 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -1175,7 +1175,7 @@ static int st_pctl_dt_calculate_pin(struct st_pinctrl *info,
>  
>  	for (i = 0; i < info->nbanks; i++) {
>  		chip = &info->banks[i].gpio_chip;
> -		if (chip->of_node == np) {
> +		if (chip->fwnode == of_fwnode_handle(np)) {

Are you sure chip's fwnode is properly set here (without your other
patch)? I don't believe the driver sets it up, and I don't think gpiolib
maps it from the gpio_chip->of_node.

Actually, there is another reference to of_node in gpio chip in
st_gpiolib_register_bank()...

Thanks.

-- 
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-10-10  6:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 12:54 [PATCH v1 1/1] pinctrl: st: Avoid using of_node member of struct gpio_chip Andy Shevchenko
2022-10-04 12:54 ` Andy Shevchenko
2022-10-10  6:13 ` Dmitry Torokhov [this message]
2022-10-10  6:13   ` Dmitry Torokhov
2022-10-10  6:47   ` Andy Shevchenko
2022-10-10  6:47     ` Andy Shevchenko

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=Y0O4GNR28kSOR1Iu@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrice.chotard@foss.st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.