From: Wolfram Sang Date: Tue, 28 Oct 2014 16:40:40 +0000 (+0100) Subject: core: platform: add warning if driver has no owner X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=161d6981096f5700ff5a2618bc9337c157eb717a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Greg Kroah-Hartman --- 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))