Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: mockup: Drop duplicate NULL check in gpio_mockup_unregister_pdevs()

Since platform_device_unregister() is NULL-aware, we don't need to duplicate
this check. Remove it and fold the rest of the code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

authored by

Andy Shevchenko and committed by
Bartosz Golaszewski
e5391a02 266315fb

+2 -7
+2 -7
drivers/gpio/gpio-mockup.c
··· 479 479 480 480 static void gpio_mockup_unregister_pdevs(void) 481 481 { 482 - struct platform_device *pdev; 483 482 int i; 484 483 485 - for (i = 0; i < GPIO_MOCKUP_MAX_GC; i++) { 486 - pdev = gpio_mockup_pdevs[i]; 487 - 488 - if (pdev) 489 - platform_device_unregister(pdev); 490 - } 484 + for (i = 0; i < GPIO_MOCKUP_MAX_GC; i++) 485 + platform_device_unregister(gpio_mockup_pdevs[i]); 491 486 } 492 487 493 488 static __init char **gpio_mockup_make_line_names(const char *label,