提交 9af1e44f 编写于 作者: S Stephen Warren 提交者: Linus Walleij

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: NStephen Warren <swarren@nvidia.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 25aec320
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册