]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pinctrl: Don't copy pin names when registering them
authorStephen Warren <swarren@nvidia.com>
Wed, 19 Oct 2011 22:19:27 +0000 (16:19 -0600)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 28 Oct 2011 19:41:17 +0000 (21:41 +0200)
A pin controller's names array is no longer marked __refdata. Hence, we
can avoid copying a pin's name into the descriptor when registering it.
Instead, just point at the string supplied in the pin array.

This both simplifies and speeds up pin controller initialization, but
also removes the hard-coded maximum pin name length.

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

index ceb63275c7fe3ca1eff3c74c008a3fda6b07ce7d..423522d87313b583620ddbad5d85272793e0e794 100644 (file)
@@ -164,9 +164,8 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev,
        /* Set owner */
        pindesc->pctldev = pctldev;
 
-       /* Copy optional basic pin info */
-       if (name)
-               strlcpy(pindesc->name, name, sizeof(pindesc->name));
+       /* Copy basic pin info */
+       pindesc->name = name;
 
        spin_lock(&pctldev->pin_desc_tree_lock);
        radix_tree_insert(&pctldev->pin_desc_tree, number, pindesc);
index 17e07772160c506db29e5f42ae345c8fe8ce08e0..e431aa537287d3545dae37eafd3730403a1883c5 100644 (file)
@@ -55,7 +55,7 @@ struct pinctrl_dev {
  */
 struct pin_desc {
        struct pinctrl_dev *pctldev;
-       char    name[16];
+       const char *name;
        spinlock_t lock;
        /* These fields only added when supporting pinmux drivers */
 #ifdef CONFIG_PINMUX