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

Configure Feed

Select the types of activity you want to include in your feed.

driver core: platform: removed unneeded variable from __platform_driver_probe()

In the reworking of the function __platform_driver_probe() over the
years, it turns out that the variable 'code' does not actually do
anything or mean anything anymore and can be removed to simplify the
logic when trying to read and understand what this function is actually
doing.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Link: https://lore.kernel.org/r/20230131082459.301603-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+4 -4
+4 -4
drivers/base/platform.c
··· 906 906 int __init_or_module __platform_driver_probe(struct platform_driver *drv, 907 907 int (*probe)(struct platform_device *), struct module *module) 908 908 { 909 - int retval, code; 909 + int retval; 910 910 911 911 if (drv->driver.probe_type == PROBE_PREFER_ASYNCHRONOUS) { 912 912 pr_err("%s: drivers registered with %s can not be probed asynchronously\n", ··· 932 932 933 933 /* temporary section violation during probe() */ 934 934 drv->probe = probe; 935 - retval = code = __platform_driver_register(drv, module); 935 + retval = __platform_driver_register(drv, module); 936 936 if (retval) 937 937 return retval; 938 938 ··· 944 944 */ 945 945 spin_lock(&drv->driver.bus->p->klist_drivers.k_lock); 946 946 drv->probe = platform_probe_fail; 947 - if (code == 0 && list_empty(&drv->driver.p->klist_devices.k_list)) 947 + if (list_empty(&drv->driver.p->klist_devices.k_list)) 948 948 retval = -ENODEV; 949 949 spin_unlock(&drv->driver.bus->p->klist_drivers.k_lock); 950 950 951 - if (code != retval) 951 + if (retval) 952 952 platform_driver_unregister(drv); 953 953 return retval; 954 954 }