From: Andy Shevchenko Date: Mon, 14 Nov 2022 18:46:26 +0000 (+0200) Subject: gpiolib: of: Drop redundant check in of_mm_gpiochip_remove() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a431803852de00d8d3c143b19f5690254225538f;p=linux.git gpiolib: of: Drop redundant check in of_mm_gpiochip_remove() The callers never call the function with invalid pointer. Moreover, compiler quite likely dropped that check anyway because we use that pointer before the check. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij Reviewed-by: Dmitry Torokhov Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index c9b0c9fdeca8a..a6871859a59de 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -961,9 +961,6 @@ void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc) { struct gpio_chip *gc = &mm_gc->gc; - if (!mm_gc) - return; - gpiochip_remove(gc); iounmap(mm_gc->regs); kfree(gc->label);