From: Andy Shevchenko Date: Fri, 23 Feb 2024 19:49:54 +0000 (+0200) Subject: mfd: kempld: Drop duplicate NULL check in ->exit() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=de584f72ce1035b2c32351d56f3d6c147e382e37;p=linux.git mfd: kempld: Drop duplicate NULL check in ->exit() 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 Link: https://lore.kernel.org/r/20240223195113.880121-6-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones --- diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c index c3bc61dcd098f..30b8408c094e8 100644 --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c @@ -895,9 +895,7 @@ static int __init kempld_init(void) static void __exit kempld_exit(void) { - if (kempld_pdev) - platform_device_unregister(kempld_pdev); - + platform_device_unregister(kempld_pdev); platform_driver_unregister(&kempld_driver); }