summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/core.c
diff options
context:
space:
mode:
authorStephen Warren2011-10-20 00:19:27 +0200
committerLinus Walleij2011-10-20 11:50:06 +0200
commit9af1e44fb4a4c62a90bff9b095eb001764d91b65 (patch)
treeee15dbb393b2805b0da4daeda4f0cfc931fe42ca /drivers/pinctrl/core.c
parentpinctrl: Remove unsafe __refdata (diff)
downloadkernel-qcow2-linux-9af1e44fb4a4c62a90bff9b095eb001764d91b65.tar.gz
kernel-qcow2-linux-9af1e44fb4a4c62a90bff9b095eb001764d91b65.tar.xz
kernel-qcow2-linux-9af1e44fb4a4c62a90bff9b095eb001764d91b65.zip
pinctrl: Don't copy pin names when registering them
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>
Diffstat (limited to 'drivers/pinctrl/core.c')
-rw-r--r--drivers/pinctrl/core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index ceb63275c7fe..423522d87313 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -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);