diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2014-10-28 17:40:40 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-06 15:16:01 -0800 |
commit | 161d6981096f5700ff5a2618bc9337c157eb717a (patch) | |
tree | 29a6f7a874eaaebb0aab056747583a563126283b | |
parent | a8a93c6f9922c0d70459668c1300b226cb3918ab (diff) |
core: platform: add warning if driver has no owner
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/base/driver.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 9e29943e56c..6b10ff3bb41 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)) |