From 6c325f874c9a4b5a783ed6c4a88fdddfc380acb1 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 19 Aug 2013 10:06:29 +0800 Subject: 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 Signed-off-by: Linus Walleij --- drivers/pinctrl/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/pinctrl') 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) 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; } -- cgit v1.2.3