Commit f17e1444 authored by Patrick Mochel's avatar Patrick Mochel

driver model: make sure driver is added to class it belongs to.

devclass_{add,remove}_driver() had been implemented, but had never been
called.
parent dcb28a19
......@@ -19,6 +19,9 @@ extern void bus_remove_driver(struct device_driver *);
extern int devclass_add_device(struct device *);
extern void devclass_remove_device(struct device *);
extern int devclass_add_driver(struct device_driver *);
extern void devclass_remove_driver(struct device_driver *);
extern int interface_add(struct device_class *, struct device *);
extern void interface_remove(struct device_class *, struct device *);
......
......@@ -118,6 +118,7 @@ int driver_register(struct device_driver * drv)
INIT_LIST_HEAD(&drv->devices);
drv->present = 1;
bus_add_driver(drv);
devclass_add_driver(drv);
put_driver(drv);
return 0;
}
......@@ -128,6 +129,9 @@ void driver_unregister(struct device_driver * drv)
drv->present = 0;
spin_unlock(&device_lock);
pr_debug("driver %s:%s: unregistering\n",drv->bus->name,drv->name);
bus_remove_driver(drv);
devclass_remove_driver(drv);
kobject_unregister(&drv->kobj);
put_driver(drv);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment