Skip to content

Commit

Permalink
gpiolib: Follow usual pattern for gpiod_remove_lookup_table() call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko authored and Wolfram Sang committed Jan 5, 2021
1 parent cb97441 commit d321ad1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d321ad1

Please sign in to comment.