pinctrl: core: Remove unnecessary test for desc->name
authorAxel Lin <axel.lin@ingics.com>
Mon, 19 Aug 2013 02:06:29 +0000 (10:06 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 23 Aug 2013 06:56:29 +0000 (08:56 +0200)
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>
drivers/pinctrl/core.c

index faeb8726aee0a2fc7df416d0076299f631cd18c9..7094a812900880c7224846ae471150adbecff902 100644 (file)
@@ -153,9 +153,7 @@ int pin_get_from_name(struct pinctrl_dev *pctldev, const char *name)
                pin = pctldev->desc->pins[i].number;
                desc = pin_desc_get(pctldev, pin);
                /* Pin space may be sparse */
-               if (desc == NULL)
-                       continue;
-               if (desc->name && !strcmp(name, desc->name))
+               if (desc && !strcmp(name, desc->name))
                        return pin;
        }