Thread (3 messages) flat view 3 messages, 3 authors, 2012-10-19

[PATCH] pinctrl: reserve pins when states are activated

From: Linus Walleij <hidden>
Date: 2012-10-19 12:51:24
Also in: lkml

On Fri, Oct 19, 2012 at 1:33 AM, Stephen Warren [off-list ref] wrote:
On 10/18/2012 04:01 AM, Linus Walleij wrote:
quoted
This switches the way that pins are reserved for multiplexing:
The conceptual change makes perfect sense to me.
Thanks...
quoted
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
quoted
 void pinmux_free_setting(struct pinctrl_setting const *setting)
...
quoted
+     /*
+      * If a setting is active, disable it so that all pins are released
+      */
+     pinmux_disable_setting(setting);
"*If* a setting is active ..." implies there should be a C if statement
here to check if the setting is actually active before trying to disable it?
Spot on.

Actually in core.c we're already checking this:

	case PIN_MAP_TYPE_MUX_GROUP:
		if (state == p->state)
			pinmux_disable_setting(setting);
		pinmux_free_setting(setting);
		break;

So this is just buggy driving the refcount down to negative.
(I think Jean-Nicolas noticed this phenomenon...)

I should just delete pinmux_free_setting().

Yours,
Linus Walleij

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help