diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-03-09 19:56:26 +0100 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-03-15 10:47:55 +0100 |
commit | c122f461ccac0e78e8e45d4f6de14e58942572f6 (patch) | |
tree | 6edb7634c04380ec94c9b24a10d0dbf47959a28f /drivers/gpio | |
parent | gpiolib: Move gpiodevice_*() to gpiodev namespace (diff) | |
download | linux-c122f461ccac0e78e8e45d4f6de14e58942572f6.tar.xz linux-c122f461ccac0e78e8e45d4f6de14e58942572f6.zip |
gpiolib: Remove duplicative check in gpiod_find_and_request()
The gpiod_find_by_fwnode() already checks for NULL and returns
correct error code in case fwnode is invalid. Drop the respective
check and assignment in the gpiod_find_and_request().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 0589451e65cb..405070484fe3 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -3926,13 +3926,10 @@ static struct gpio_desc *gpiod_find_and_request(struct device *consumer, bool platform_lookup_allowed) { unsigned long lookupflags = GPIO_LOOKUP_FLAGS_DEFAULT; - struct gpio_desc *desc = ERR_PTR(-ENOENT); + struct gpio_desc *desc; int ret; - if (!IS_ERR_OR_NULL(fwnode)) - desc = gpiod_find_by_fwnode(fwnode, consumer, con_id, idx, - &flags, &lookupflags); - + desc = gpiod_find_by_fwnode(fwnode, consumer, con_id, idx, &flags, &lookupflags); if (gpiod_not_found(desc) && platform_lookup_allowed) { /* * Either we are not using DT or ACPI, or their lookup did not |