diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-08-18 22:06:29 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-08-23 02:56:29 -0400 |
commit | 6c325f874c9a4b5a783ed6c4a88fdddfc380acb1 (patch) | |
tree | e1e0ce004541036b72541e17e0facaaa98b028de /drivers/pinctrl | |
parent | e2b86b8481502f3f3039a31aa1a85b8a29e246f1 (diff) |
pinctrl: core: Remove unnecessary test for desc->name
The implementation in pinctrl_register_one_pin() ensures pindesc->name is always
not NULL before insert the pindesc to radix tree.
If the desc return from pin_desc_get is not NULL, desc->name is always not NULL.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index faeb8726aee0..7094a8129008 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -153,9 +153,7 @@ int pin_get_from_name(struct pinctrl_dev *pctldev, const char *name) | |||
153 | pin = pctldev->desc->pins[i].number; | 153 | pin = pctldev->desc->pins[i].number; |
154 | desc = pin_desc_get(pctldev, pin); | 154 | desc = pin_desc_get(pctldev, pin); |
155 | /* Pin space may be sparse */ | 155 | /* Pin space may be sparse */ |
156 | if (desc == NULL) | 156 | if (desc && !strcmp(name, desc->name)) |
157 | continue; | ||
158 | if (desc->name && !strcmp(name, desc->name)) | ||
159 | return pin; | 157 | return pin; |
160 | } | 158 | } |
161 | 159 | ||