]> git.karo-electronics.de Git - karo-tx-linux.git/commit
pinctrl: Don't copy function name when requesting a pin
authorStephen Warren <swarren@nvidia.com>
Wed, 19 Oct 2011 22:19:28 +0000 (16:19 -0600)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 28 Oct 2011 19:41:17 +0000 (21:41 +0200)
commit1a8a93faf41ca80df33837c90b0ff33dd26a4113
tree0e7af68220717cc9dc9df6a5b29a2148c9f126d7
parent5f2cdb596c830a02ae89c1d33a9a318846877be2
pinctrl: Don't copy function name when requesting a pin

Instead, store a pointer to the currently assigned function.

This allows us to delete the mux_requested variable from pin_desc; a pin
is requested if its currently assigned function is non-NULL.

When a pin is requested as a GPIO rather than a regular function, the
assigned function name is dynamically constructed. In this case, we have
to kstrdup() the dynamically constructed name, so that mux_function doesn't
pointed at stack data. This requires pin_free to be told whether to free
the mux_function pointer or not.

This removes the hard-coded maximum function name length.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/core.h
drivers/pinctrl/pinmux.c