summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-12-28 22:06:16 +0200
committerWolfram Sang <wsa@kernel.org>2021-01-05 11:28:44 +0100
commitd321ad1286d2ac1f14fccadee822519a6ac9dd64 (patch)
tree3022fd1a6c48ac496ce70946a43b00afe2f7aa78 /drivers/gpio/gpiolib.c
parentcb9744178f330dcd5ea73788eba00b65deb068bb (diff)
downloadlinux-d321ad1286d2ac1f14fccadee822519a6ac9dd64.tar.gz
linux-d321ad1286d2ac1f14fccadee822519a6ac9dd64.tar.bz2
linux-d321ad1286d2ac1f14fccadee822519a6ac9dd64.zip
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 <andriy.shevchenko@linux.intel.com> Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index b02cc2abd3b6..611d6ea82d75 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);