diff options
author | Patrick Pannuto <ppannuto@codeaurora.org> | 2010-08-06 17:12:41 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 10:16:42 -0700 |
commit | d79d32440c33cf60f1e0efbeb8144b1647be0b50 (patch) | |
tree | 31b9ff92f2f0c9c50e21427ac7d69185b6789f0f /drivers/base/platform.c | |
parent | 6a5c083de2f5fbf89a4b0a251be2c2205434d7ea (diff) |
driver core: platform: Use drv->driver.bus instead of assuming platform_bus_type
In theory (although not *yet* in practice), a driver being passed
to platform_driver_probe might have driver.bus set to something
other than platform_bus_type. Locking drv->driver.bus is always
correct.
Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index c6c933f58102..579906f88b09 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -488,12 +488,12 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv, * if the probe was successful, and make sure any forced probes of * new devices fail. */ - spin_lock(&platform_bus_type.p->klist_drivers.k_lock); + spin_lock(&drv->driver.bus->p->klist_drivers.k_lock); drv->probe = NULL; if (code == 0 && list_empty(&drv->driver.p->klist_devices.k_list)) retval = -ENODEV; drv->driver.probe = platform_drv_probe_fail; - spin_unlock(&platform_bus_type.p->klist_drivers.k_lock); + spin_unlock(&drv->driver.bus->p->klist_drivers.k_lock); if (code != retval) platform_driver_unregister(drv); |