Skip to content

Commit 161d698

Browse files
Wolfram Sanggregkh
authored andcommitted
core: platform: add warning if driver has no owner
Commit 9447057 ("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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a8a93c6 commit 161d698

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/base/driver.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ int driver_register(struct device_driver *drv)
151151

152152
BUG_ON(!drv->bus->p);
153153

154+
if (!drv->owner)
155+
printk(KERN_WARNING "Driver '%s' needs an owner", drv->name);
156+
154157
if ((drv->bus->probe && drv->probe) ||
155158
(drv->bus->remove && drv->remove) ||
156159
(drv->bus->shutdown && drv->shutdown))

0 commit comments

Comments
 (0)