diff options
author | 2025-04-16 12:55:12 +0300 | |
---|---|---|
committer | 2025-04-17 15:22:05 +0200 | |
commit | df6dccb4aeab5f19c8451d960259fd1d911f3129 (patch) | |
tree | a8b5821a50d423a695626f72db2d996d71254028 | |
parent | gpiolib: Print actual error when descriptor contains an error pointer (diff) | |
download | linux-rng-df6dccb4aeab5f19c8451d960259fd1d911f3129.tar.xz linux-rng-df6dccb4aeab5f19c8451d960259fd1d911f3129.zip |
gpiolib: Revert "Don't WARN on gpiod_put() for optional GPIO"
No need to double check the pointer for NULL since gpiod_free()
is using VALIDATE_DESC_VOID() which simply returns in that case.
This reverts commit 1d7765ba15aca68f3bc52f59434c1c34855bbb54.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250416095645.2027695-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
-rw-r--r-- | drivers/gpio/gpiolib.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index e8e75da7b177..7ab408b44893 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -5140,8 +5140,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_array_optional); */ void gpiod_put(struct gpio_desc *desc) { - if (desc) - gpiod_free(desc); + gpiod_free(desc); } EXPORT_SYMBOL_GPL(gpiod_put); |