pinctrl: st: Avoid using of_node member of struct gpio_chip
Subsystems (3)
PATCH 1/1 pinctrl: st: Avoid using of_node member of struct gpio_chip
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.
--- drivers/pinctrl/pinctrl-st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-st.c +1 -1
@@ -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 ;
Signature · 7 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Andy,
Quoted 17 lines · Andy Shevchenko
The
of_nodemember of the structgpio_chipis 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 <[email protected]>--- drivers/pinctrl/pinctrl-st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/pinctrl-st.c +0
-0
drivers/pinctrl/pinctrl-st.c static int st_pctl_dt_calculate_pin(struct st_pinctrl *info, · line 1178
Quoted 5 lines
drivers/pinctrl/pinctrl-st.c +1
-1@@ -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.
Signature · 1 line
Dmitry
Quoted 8 lines · Dmitry Torokhov
Quoted 7 lines · Andy Shevchenko
The
of_nodemember of the structgpio_chipis 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()")
...
Quoted 6 lines
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_nodein gpio chip inst_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.
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel