From: Andy Shevchenko Date: Mon, 28 Dec 2020 20:06:16 +0000 (+0200) Subject: gpiolib: Follow usual pattern for gpiod_remove_lookup_table() call X-Git-Tag: v5.15~1723^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d321ad1286d2ac1f14fccadee822519a6ac9dd64;p=platform%2Fkernel%2Flinux-starfive.git gpiolib: Follow usual pattern for gpiod_remove_lookup_table() call The usual pattern for the remove calls, like gpiod_remove_lookup_table(), is to be NULL-aware, i.o.w. become a no-op whenever parameter is NULL. Update gpiod_remove_lookup_table() call to follow this pattern. Signed-off-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Signed-off-by: Wolfram Sang --- diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index b02cc2a..611d6ea 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -3460,6 +3460,10 @@ EXPORT_SYMBOL_GPL(gpiod_add_lookup_table); */ void gpiod_remove_lookup_table(struct gpiod_lookup_table *table) { + /* Nothing to remove */ + if (!table) + return; + mutex_lock(&gpio_lookup_lock); list_del(&table->list);