diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/base/driver.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index ba912558a510..857c8f1b876e 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c | |||
| @@ -148,7 +148,11 @@ int driver_register(struct device_driver *drv) | |||
| 148 | int ret; | 148 | int ret; |
| 149 | struct device_driver *other; | 149 | struct device_driver *other; |
| 150 | 150 | ||
| 151 | BUG_ON(!drv->bus->p); | 151 | if (!drv->bus->p) { |
| 152 | pr_err("Driver '%s' was unable to register with bus_type '%s' because the bus was not initialized.\n", | ||
| 153 | drv->name, drv->bus->name); | ||
| 154 | return -EINVAL; | ||
| 155 | } | ||
| 152 | 156 | ||
| 153 | if ((drv->bus->probe && drv->probe) || | 157 | if ((drv->bus->probe && drv->probe) || |
| 154 | (drv->bus->remove && drv->remove) || | 158 | (drv->bus->remove && drv->remove) || |
