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

mfd: kempld-core: Simplify function return logic

The invoked functions already return zero on success or a negative
errno code so there is no need to open code the logic in the caller.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Javier Martinez Canillas and committed by
Lee Jones
d8498df1 e7238fd2

+2 -12
+2 -12
drivers/mfd/kempld-core.c
··· 448 448 struct device *dev = &pdev->dev; 449 449 struct kempld_device_data *pld; 450 450 struct resource *ioport; 451 - int ret; 452 451 453 452 pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); 454 453 if (!pld) ··· 470 471 mutex_init(&pld->lock); 471 472 platform_set_drvdata(pdev, pld); 472 473 473 - ret = kempld_detect_device(pld); 474 - if (ret) 475 - return ret; 476 - 477 - return 0; 474 + return kempld_detect_device(pld); 478 475 } 479 476 480 477 static int kempld_remove(struct platform_device *pdev) ··· 751 756 static int __init kempld_init(void) 752 757 { 753 758 const struct dmi_system_id *id; 754 - int ret; 755 759 756 760 if (force_device_id[0]) { 757 761 for (id = kempld_dmi_table; ··· 765 771 return -ENODEV; 766 772 } 767 773 768 - ret = platform_driver_register(&kempld_driver); 769 - if (ret) 770 - return ret; 771 - 772 - return 0; 774 + return platform_driver_register(&kempld_driver); 773 775 } 774 776 775 777 static void __exit kempld_exit(void)