Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: ralink: rt2880: avoid to error in calls is pin is already enabled

In 'rt2880_pmx_group_enable' driver is printing an error and returning
-EBUSY if a pin has been already enabled. This begets 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 not confuse the user with a real
bad problem.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210604055337.20407-1-sergio.paracuellos@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Sergio Paracuellos and committed by
Linus Walleij
eb367d87 0e4bf265

+1 -1
+1 -1
drivers/pinctrl/ralink/pinctrl-rt2880.c
··· 127 127 if (p->groups[group].enabled) { 128 128 dev_err(p->dev, "%s is already enabled\n", 129 129 p->groups[group].name); 130 - return -EBUSY; 130 + return 0; 131 131 } 132 132 133 133 p->groups[group].enabled = 1;