linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/3] gpiolib: Follow usual pattern for gpiod_remove_lookup_table() call
@ 2020-12-28 20:06 Andy Shevchenko
  2020-12-28 20:06 ` [PATCH v1 2/3] i2c: i801: Drop duplicate NULL check in i801_del_mux() Andy Shevchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Andy Shevchenko @ 2020-12-28 20:06 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, linux-gpio, Jean Delvare,
	Wolfram Sang, linux-i2c
  Cc: Andy Shevchenko

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>
---
 drivers/gpio/gpiolib.c | 4 ++++
 1 file changed, 4 insertions(+)

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);
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-06 16:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28 20:06 [PATCH v1 1/3] gpiolib: Follow usual pattern for gpiod_remove_lookup_table() call Andy Shevchenko
2020-12-28 20:06 ` [PATCH v1 2/3] i2c: i801: Drop duplicate NULL check in i801_del_mux() Andy Shevchenko
2021-01-06 16:03   ` Jean Delvare
2020-12-28 20:06 ` [PATCH v1 3/3] i2c: i801: Refactor mux code since platform_device_unregister() is NULL aware Andy Shevchenko
2021-01-06 16:03   ` Jean Delvare
2021-01-04 14:24 ` [PATCH v1 1/3] gpiolib: Follow usual pattern for gpiod_remove_lookup_table() call Bartosz Golaszewski
2021-01-04 14:33   ` Andy Shevchenko
2021-01-04 14:59     ` Bartosz Golaszewski
2021-01-06 16:03 ` Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).