[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55670BDE.5070103@oracle.com>
Date: Thu, 28 May 2015 08:36:46 -0400
From: Sasha Levin <sasha.levin@...cle.com>
To: Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Greg KH <gregkh@...uxfoundation.org>
CC: Alan Stern <stern@...land.harvard.edu>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Tal Shorer <tal.shorer@...il.com>,
USB list <linux-usb@...r.kernel.org>,
"<linux-kernel@...r.kernel.org>" <linux-kernel@...r.kernel.org>,
David Cohen <david.a.cohen@...ux.intel.com>,
Felipe Balbi <balbi@...com>,
Lu Baolu <baolu.lu@...ux.intel.com>
Subject: Re: [PATCH] usb: ulpi: don't register drivers if bus doesn't exist
On 05/28/2015 01:39 AM, Sudip Mukherjee wrote:
> diff --git a/drivers/base/driver.c b/drivers/base/driver.c
> index 4eabfe2..1acae5b 100644
> --- a/drivers/base/driver.c
> +++ b/drivers/base/driver.c
> @@ -150,6 +150,11 @@ int driver_register(struct device_driver *drv)
> int ret;
> struct device_driver *other;
>
> + if (!drv->bus->registered) {
> + pr_err("Driver %s registration failed. bus not yet registered\n",
> + drv->name);
> + return -ENODEV;
> + }
> BUG_ON(!drv->bus->p);
This is a design issue with the code in the layer above, there's no reason
driver_register() should be called with a bus that wasn't registered to
begin with.
This is why there's a BUG_ON there to catch these issues - it's a bug, not
a desired behaviour.
Thanks,
Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists