gpiolib: acpi: Remove never true check in acpi_get_gpiod_by_index()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 10 Apr 2024 20:21:46 +0000 (23:21 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 11 Apr 2024 13:37:08 +0000 (16:37 +0300)
The acpi_get_gpiod_by_index() never is called with adev being NULL.
Remove the redundant check.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/gpio/gpiolib-acpi.c

index 7f140df40f35bd104f3742774eeeba171e497f67..f596edf89451c5ec6e80f7f8197402de0352ae9a 100644 (file)
@@ -873,9 +873,6 @@ static struct gpio_desc *acpi_get_gpiod_by_index(struct acpi_device *adev,
        struct acpi_gpio_lookup lookup;
        int ret;
 
-       if (!adev)
-               return ERR_PTR(-ENODEV);
-
        memset(&lookup, 0, sizeof(lookup));
        lookup.index = index;