driver-core: do not register a driver with bus_type not registered
[safe/jmp/linux-2.6] / drivers / base / driver.c
index 1e2bda7..2889ad5 100644 (file)
@@ -216,6 +216,8 @@ int driver_register(struct device_driver *drv)
        int ret;
        struct device_driver *other;
 
+       BUG_ON(!drv->bus->p);
+
        if ((drv->bus->probe && drv->probe) ||
            (drv->bus->remove && drv->remove) ||
            (drv->bus->shutdown && drv->shutdown))