From: Wolfram Sang <wsa@the-dreams.de>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Julia Lawall <julia.lawall@lip6.fr>,
Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH RESEND 1/4] core: platform: add warning if driver has no owner
Date: Tue, 28 Oct 2014 17:40:40 +0100 [thread overview]
Message-ID: <1414514443-28943-2-git-send-email-wsa@the-dreams.de> (raw)
In-Reply-To: <1414514443-28943-1-git-send-email-wsa@the-dreams.de>
Commit 9447057eaff8 ("platform_device: use a macro instead of
platform_driver_register") introduced a codepath which could result into
drivers having no owner. This went unnoticed for months, so add a
warning in case this happens again somewhere else somewhen.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
drivers/base/driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 9e29943e56ca..6b10ff3bb410 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -151,6 +151,9 @@ int driver_register(struct device_driver *drv)
BUG_ON(!drv->bus->p);
+ if (!drv->owner)
+ printk(KERN_WARNING "Driver '%s' needs an owner", drv->name);
+
if ((drv->bus->probe && drv->probe) ||
(drv->bus->remove && drv->remove) ||
(drv->bus->shutdown && drv->shutdown))
--
2.0.0
next prev parent reply other threads:[~2014-10-28 16:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-28 16:40 [PATCH RESEND 0/4] platform: fix accidently erasing .owner Wolfram Sang
2014-10-28 16:40 ` Wolfram Sang [this message]
2014-11-10 21:32 ` [PATCH RESEND 1/4] core: platform: add warning if driver has no owner Tony Luck
2014-11-11 5:30 ` Greg KH
2014-10-28 16:40 ` [PATCH RESEND 2/4] core: platform: let platform_driver_probe initialize module owner Wolfram Sang
2014-10-28 16:40 ` [PATCH RESEND 3/4] core: platform: let platform_create_bundle " Wolfram Sang
2014-10-28 16:40 ` [PATCH RESEND 4/4] coccinelle: api: add spatch to prevent unnecessary .owner Wolfram Sang
2014-10-28 20:58 ` Julia Lawall
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=1414514443-28943-2-git-send-email-wsa@the-dreams.de \
--to=wsa@the-dreams.de \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®