From 5d2eaf8090874f8e65388e82f7e91f9cef74885e Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 19 Oct 2011 16:19:28 -0600 Subject: 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 Signed-off-by: Linus Walleij --- drivers/pinctrl/core.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/pinctrl/core.h') diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index e431aa537287..472fa1341cc0 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -59,8 +59,7 @@ struct pin_desc { spinlock_t lock; /* These fields only added when supporting pinmux drivers */ #ifdef CONFIG_PINMUX - bool mux_requested; - char mux_function[16]; + const char *mux_function; #endif }; -- cgit v1.2.3