All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the pinctrl tree with the gpio-intel tree
@ 2022-05-02  6:45 Stephen Rothwell
  2022-05-02 15:42 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2022-05-02  6:45 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko
  Cc: Fabien Dessenne, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 3003 bytes --]

Hi all,

Today's linux-next merge of the pinctrl tree got a conflict in:

  drivers/pinctrl/stm32/pinctrl-stm32.c

between commit:

  bb949ed9b16b ("pinctrl: stm32: Switch to use for_each_gpiochip_node() helper")

from the gpio-intel tree and commit:

  c954531bc5d8 ("pinctrl: stm32: improve bank clocks management")

from the pinctrl tree.

I fixed it up (I think, see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/pinctrl/stm32/pinctrl-stm32.c
index 7aecd0efde07,b308e7bb7487..000000000000
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@@ -1544,34 -1508,44 +1506,38 @@@ int stm32_pctl_probe(struct platform_de
  		return -ENOMEM;
  
  	i = 0;
 -	for_each_available_child_of_node(np, child) {
 +	for_each_gpiochip_node(dev, child) {
  		struct stm32_gpio_bank *bank = &pctl->banks[i];
 +		struct device_node *np = to_of_node(child);
  
 -		if (of_property_read_bool(child, "gpio-controller")) {
 -			bank->rstc = of_reset_control_get_exclusive(child,
 -								    NULL);
 -			if (PTR_ERR(bank->rstc) == -EPROBE_DEFER) {
 -				of_node_put(child);
 -				return -EPROBE_DEFER;
 -			}
 -
 -			bank->clk = of_clk_get_by_name(child, NULL);
 -			if (IS_ERR(bank->clk)) {
 -				if (PTR_ERR(bank->clk) != -EPROBE_DEFER)
 -					dev_err(dev,
 -						"failed to get clk (%ld)\n",
 -						PTR_ERR(bank->clk));
 -				of_node_put(child);
 -				return PTR_ERR(bank->clk);
 -			}
 -			i++;
 +		bank->rstc = of_reset_control_get_exclusive(np, NULL);
 +		if (PTR_ERR(bank->rstc) == -EPROBE_DEFER) {
 +			fwnode_handle_put(child);
 +			return -EPROBE_DEFER;
  		}
 -	}
  
 -	for_each_available_child_of_node(np, child) {
 -		if (of_property_read_bool(child, "gpio-controller")) {
 -			ret = stm32_gpiolib_register_bank(pctl, child);
 -			if (ret) {
 -				of_node_put(child);
 +		bank->clk = of_clk_get_by_name(np, NULL);
 +		if (IS_ERR(bank->clk)) {
 +			if (PTR_ERR(bank->clk) != -EPROBE_DEFER)
 +				dev_err(dev, "failed to get clk (%ld)\n", PTR_ERR(bank->clk));
 +			fwnode_handle_put(child);
 +			return PTR_ERR(bank->clk);
 +		}
 +		i++;
 +	}
  
 -				for (i = 0; i < pctl->nbanks; i++)
 -					clk_disable_unprepare(pctl->banks[i].clk);
 +	for_each_gpiochip_node(dev, child) {
 +		ret = stm32_gpiolib_register_bank(pctl, child);
 +		if (ret) {
 +			fwnode_handle_put(child);
+ 
 -				return ret;
 -			}
++			for (i = 0; i < pctl->nbanks; i++)
++				clk_disable_unprepare(pctl->banks[i].clk);
+ 
 -			pctl->nbanks++;
 +			return ret;
  		}
 +
 +		pctl->nbanks++;
  	}
  
  	dev_info(dev, "Pinctrl STM32 initialized\n");

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the pinctrl tree with the gpio-intel tree
  2022-05-02  6:45 linux-next: manual merge of the pinctrl tree with the gpio-intel tree Stephen Rothwell
@ 2022-05-02 15:42 ` Andy Shevchenko
  2022-05-04 21:18   ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2022-05-02 15:42 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Linus Walleij, Andy Shevchenko, Fabien Dessenne,
	Linux Kernel Mailing List, Linux Next Mailing List

On Mon, May 2, 2022 at 5:39 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> Today's linux-next merge of the pinctrl tree got a conflict in:
>
>   drivers/pinctrl/stm32/pinctrl-stm32.c
>
> between commit:
>
>   bb949ed9b16b ("pinctrl: stm32: Switch to use for_each_gpiochip_node() helper")
>
> from the gpio-intel tree and commit:
>
>   c954531bc5d8 ("pinctrl: stm32: improve bank clocks management")
>
> from the pinctrl tree.
>
> I fixed it up (I think, see below) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging.  You may also want to consider
> cooperating with the maintainer of the conflicting tree to minimise any
> particularly complex conflicts.

Thanks for the fix. I think the best course of action is that Linus W.
can pull the same branch that GPIO tree has into the pin control tree
and resolve that, because the drivers touched are all pin control
drivers while the core part of GPIO subsystem was updated.

> --
> Cheers,
> Stephen Rothwell
>
> diff --cc drivers/pinctrl/stm32/pinctrl-stm32.c
> index 7aecd0efde07,b308e7bb7487..000000000000
> --- a/drivers/pinctrl/stm32/pinctrl-stm32.c
> +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
> @@@ -1544,34 -1508,44 +1506,38 @@@ int stm32_pctl_probe(struct platform_de
>                 return -ENOMEM;
>
>         i = 0;
>  -      for_each_available_child_of_node(np, child) {
>  +      for_each_gpiochip_node(dev, child) {
>                 struct stm32_gpio_bank *bank = &pctl->banks[i];
>  +              struct device_node *np = to_of_node(child);
>
>  -              if (of_property_read_bool(child, "gpio-controller")) {
>  -                      bank->rstc = of_reset_control_get_exclusive(child,
>  -                                                                  NULL);
>  -                      if (PTR_ERR(bank->rstc) == -EPROBE_DEFER) {
>  -                              of_node_put(child);
>  -                              return -EPROBE_DEFER;
>  -                      }
>  -
>  -                      bank->clk = of_clk_get_by_name(child, NULL);
>  -                      if (IS_ERR(bank->clk)) {
>  -                              if (PTR_ERR(bank->clk) != -EPROBE_DEFER)
>  -                                      dev_err(dev,
>  -                                              "failed to get clk (%ld)\n",
>  -                                              PTR_ERR(bank->clk));
>  -                              of_node_put(child);
>  -                              return PTR_ERR(bank->clk);
>  -                      }
>  -                      i++;
>  +              bank->rstc = of_reset_control_get_exclusive(np, NULL);
>  +              if (PTR_ERR(bank->rstc) == -EPROBE_DEFER) {
>  +                      fwnode_handle_put(child);
>  +                      return -EPROBE_DEFER;
>                 }
>  -      }
>
>  -      for_each_available_child_of_node(np, child) {
>  -              if (of_property_read_bool(child, "gpio-controller")) {
>  -                      ret = stm32_gpiolib_register_bank(pctl, child);
>  -                      if (ret) {
>  -                              of_node_put(child);
>  +              bank->clk = of_clk_get_by_name(np, NULL);
>  +              if (IS_ERR(bank->clk)) {
>  +                      if (PTR_ERR(bank->clk) != -EPROBE_DEFER)
>  +                              dev_err(dev, "failed to get clk (%ld)\n", PTR_ERR(bank->clk));
>  +                      fwnode_handle_put(child);
>  +                      return PTR_ERR(bank->clk);
>  +              }
>  +              i++;
>  +      }
>
>  -                              for (i = 0; i < pctl->nbanks; i++)
>  -                                      clk_disable_unprepare(pctl->banks[i].clk);
>  +      for_each_gpiochip_node(dev, child) {
>  +              ret = stm32_gpiolib_register_bank(pctl, child);
>  +              if (ret) {
>  +                      fwnode_handle_put(child);
> +
>  -                              return ret;
>  -                      }
> ++                      for (i = 0; i < pctl->nbanks; i++)
> ++                              clk_disable_unprepare(pctl->banks[i].clk);
> +
>  -                      pctl->nbanks++;
>  +                      return ret;
>                 }
>  +
>  +              pctl->nbanks++;
>         }
>
>         dev_info(dev, "Pinctrl STM32 initialized\n");



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the pinctrl tree with the gpio-intel tree
  2022-05-02 15:42 ` Andy Shevchenko
@ 2022-05-04 21:18   ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2022-05-04 21:18 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Stephen Rothwell, Andy Shevchenko, Fabien Dessenne,
	Linux Kernel Mailing List, Linux Next Mailing List

On Mon, May 2, 2022 at 5:43 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:

> Thanks for the fix. I think the best course of action is that Linus W.
> can pull the same branch that GPIO tree has into the pin control tree
> and resolve that, because the drivers touched are all pin control
> drivers while the core part of GPIO subsystem was updated.

Yup did this!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-04 21:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02  6:45 linux-next: manual merge of the pinctrl tree with the gpio-intel tree Stephen Rothwell
2022-05-02 15:42 ` Andy Shevchenko
2022-05-04 21:18   ` Linus Walleij

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.