All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] pinctrl: ralink: pinctrl-rt2880: avoid to error in calls if pin is already enabled
@ 2021-06-04  5:55 Sergio Paracuellos
  2021-06-07  7:10 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Sergio Paracuellos @ 2021-06-04  5:55 UTC (permalink / raw)
  To: linus.walleij; +Cc: linux-gpio, linux-kernel

In 'rt2880_pmx_group_enable' driver is printing an error and returning
-EBUSY if a pin has been already enabled. This becomes in anoying messages
in the caller when this happens like the following:

rt2880-pinmux pinctrl: pcie is already enabled
mt7621-pci 1e140000.pcie: Error applying setting, reverse things back

To avoid this just print the already enabled message in the pinctrl
driver and return 0 instead to don't confuse the user with a real
bad problem.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
Changes in v2:
    - Fix commit message s/is/if

 drivers/pinctrl/ralink/pinctrl-rt2880.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/ralink/pinctrl-rt2880.c b/drivers/pinctrl/ralink/pinctrl-rt2880.c
index 1f4bca854add..a9b511c7e850 100644
--- a/drivers/pinctrl/ralink/pinctrl-rt2880.c
+++ b/drivers/pinctrl/ralink/pinctrl-rt2880.c
@@ -127,7 +127,7 @@ static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
 	if (p->groups[group].enabled) {
 		dev_err(p->dev, "%s is already enabled\n",
 			p->groups[group].name);
-		return -EBUSY;
+		return 0;
 	}
 
 	p->groups[group].enabled = 1;
-- 
2.25.1


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

* Re: [PATCH v2] pinctrl: ralink: pinctrl-rt2880: avoid to error in calls if pin is already enabled
  2021-06-04  5:55 [PATCH v2] pinctrl: ralink: pinctrl-rt2880: avoid to error in calls if pin is already enabled Sergio Paracuellos
@ 2021-06-07  7:10 ` Linus Walleij
  2021-06-07  7:12   ` Sergio Paracuellos
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2021-06-07  7:10 UTC (permalink / raw)
  To: Sergio Paracuellos; +Cc: open list:GPIO SUBSYSTEM, linux-kernel

On Fri, Jun 4, 2021 at 7:55 AM Sergio Paracuellos
<sergio.paracuellos@gmail.com> wrote:

> In 'rt2880_pmx_group_enable' driver is printing an error and returning
> -EBUSY if a pin has been already enabled. This becomes in anoying messages
> in the caller when this happens like the following:
>
> rt2880-pinmux pinctrl: pcie is already enabled
> mt7621-pci 1e140000.pcie: Error applying setting, reverse things back
>
> To avoid this just print the already enabled message in the pinctrl
> driver and return 0 instead to don't confuse the user with a real
> bad problem.
>
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
> Changes in v2:
>     - Fix commit message s/is/if

I just fixed up the commit manually instead, no big deal.

Thanks!
Linus Walleij

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

* Re: [PATCH v2] pinctrl: ralink: pinctrl-rt2880: avoid to error in calls if pin is already enabled
  2021-06-07  7:10 ` Linus Walleij
@ 2021-06-07  7:12   ` Sergio Paracuellos
  0 siblings, 0 replies; 3+ messages in thread
From: Sergio Paracuellos @ 2021-06-07  7:12 UTC (permalink / raw)
  To: Linus Walleij; +Cc: open list:GPIO SUBSYSTEM, linux-kernel

Hi Linus,

On Mon, Jun 7, 2021 at 9:10 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Fri, Jun 4, 2021 at 7:55 AM Sergio Paracuellos
> <sergio.paracuellos@gmail.com> wrote:
>
> > In 'rt2880_pmx_group_enable' driver is printing an error and returning
> > -EBUSY if a pin has been already enabled. This becomes in anoying messages
> > in the caller when this happens like the following:
> >
> > rt2880-pinmux pinctrl: pcie is already enabled
> > mt7621-pci 1e140000.pcie: Error applying setting, reverse things back
> >
> > To avoid this just print the already enabled message in the pinctrl
> > driver and return 0 instead to don't confuse the user with a real
> > bad problem.
> >
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> > Changes in v2:
> >     - Fix commit message s/is/if
>
> I just fixed up the commit manually instead, no big deal.

Oh, I see :)

Thanks!!
    Sergio Paracuellos
>
> Thanks!
> Linus Walleij

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

end of thread, other threads:[~2021-06-07  7:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04  5:55 [PATCH v2] pinctrl: ralink: pinctrl-rt2880: avoid to error in calls if pin is already enabled Sergio Paracuellos
2021-06-07  7:10 ` Linus Walleij
2021-06-07  7:12   ` Sergio Paracuellos

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.