* [PATCH v1 1/1] pinctrl: st: Avoid using of_node member of struct gpio_chip
@ 2022-10-04 12:54 Andy Shevchenko
2022-10-10 6:13 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2022-10-04 12:54 UTC (permalink / raw)
To: Andy Shevchenko, linux-arm-kernel, linux-gpio, linux-kernel
Cc: Patrice Chotard, Linus Walleij, Dmitry Torokhov
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)) {
if (offset < chip->ngpio)
retval = chip->base + offset;
break;
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] pinctrl: st: Avoid using of_node member of struct gpio_chip
2022-10-04 12:54 [PATCH v1 1/1] pinctrl: st: Avoid using of_node member of struct gpio_chip Andy Shevchenko
@ 2022-10-10 6:13 ` Dmitry Torokhov
2022-10-10 6:47 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2022-10-10 6:13 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-arm-kernel, linux-gpio, linux-kernel, Patrice Chotard,
Linus Walleij
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] pinctrl: st: Avoid using of_node member of struct gpio_chip
2022-10-10 6:13 ` Dmitry Torokhov
@ 2022-10-10 6:47 ` Andy Shevchenko
0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2022-10-10 6:47 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-arm-kernel, linux-gpio, linux-kernel, Patrice Chotard,
Linus Walleij
On Sun, Oct 09, 2022 at 11:13:44PM -0700, Dmitry Torokhov wrote:
> 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()")
...
> 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()...
You are right, this patch has been made on top of another not yet published
one. Hence, nothing to fix it right now.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-10 6:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-04 12:54 [PATCH v1 1/1] pinctrl: st: Avoid using of_node member of struct gpio_chip Andy Shevchenko
2022-10-10 6:13 ` Dmitry Torokhov
2022-10-10 6:47 ` Andy Shevchenko
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).