* [PATCH] platform: Use drv->driver.bus instead of assuming platform_bus_type
@ 2010-08-07 0:12 Patrick Pannuto
2010-08-07 0:25 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Patrick Pannuto @ 2010-08-07 0:12 UTC (permalink / raw)
To: linux-kernel
Cc: ppannuto, linux-arm-msm, Greg Kroah-Hartman, Magnus Damm,
Paul Mundt, Uwe Kleine-König, Rafael J. Wysocki
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>
---
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 c6c933f..579906f 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);
--
1.7.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] platform: Use drv->driver.bus instead of assuming platform_bus_type
2010-08-07 0:12 [PATCH] platform: Use drv->driver.bus instead of assuming platform_bus_type Patrick Pannuto
@ 2010-08-07 0:25 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2010-08-07 0:25 UTC (permalink / raw)
To: Patrick Pannuto
Cc: linux-kernel, linux-arm-msm, Magnus Damm, Paul Mundt,
Uwe Kleine-König, Rafael J. Wysocki
On Fri, Aug 06, 2010 at 05:12:41PM -0700, Patrick Pannuto wrote:
> 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>
Thanks, I'll queue this up after the .36 merge window is over in my
tree.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-07 0:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-07 0:12 [PATCH] platform: Use drv->driver.bus instead of assuming platform_bus_type Patrick Pannuto
2010-08-07 0:25 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).