From: Patrick Pannuto <ppannuto@codeaurora.org>
To: linux-kernel@vger.kernel.org
Cc: ppannuto@codeaurora.org, linux-arm-msm@vger.kernel.org,
magnus.damm@gmail.com, grant.likely@secretlab.ca, gregkh@suse.de,
Paul Mundt <lethal@linux-sh.org>,
Magnus Damm <damm@opensource.se>,
"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [PATCH 1/2] platform: Use drv->driver.bus instead of assuming platform_bus_type
Date: Tue, 10 Aug 2010 16:49:33 -0700 [thread overview]
Message-ID: <1281484174-32174-2-git-send-email-ppannuto@codeaurora.org> (raw)
In-Reply-To: <1281484174-32174-1-git-send-email-ppannuto@codeaurora.org>
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 4d99c8b..b69ccb4 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -539,12 +539,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
next prev parent reply other threads:[~2010-08-10 23:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 23:49 [PATCHv2 0/2] platform: Facilitate the creation of pseudo-platform buses Patrick Pannuto
2010-08-10 23:49 ` Patrick Pannuto [this message]
2010-08-10 23:49 ` [PATCH 2/2] " Patrick Pannuto
2010-08-13 1:13 ` Patrick Pannuto
2010-08-14 21:04 ` Greg KH
2010-08-13 22:05 ` Grant Likely
2010-08-16 18:47 ` Patrick Pannuto
2010-08-16 20:25 ` Grant Likely
2010-08-16 23:58 ` Michał Mirosław
2010-08-16 1:38 ` Moffett, Kyle D
2010-08-16 6:43 ` Grant Likely
2010-08-19 19:20 ` Kevin Hilman
2010-08-19 22:22 ` Grant Likely
2010-08-20 18:51 ` Kevin Hilman
2010-08-20 20:08 ` Grant Likely
2010-08-21 0:10 ` Kevin Hilman
2010-08-21 7:10 ` Grant Likely
2010-08-23 14:53 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281484174-32174-2-git-send-email-ppannuto@codeaurora.org \
--to=ppannuto@codeaurora.org \
--cc=damm@opensource.se \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@suse.de \
--cc=lethal@linux-sh.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).