list: change locking discipline
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
2cf76fd225
commit
071a5651e0
11 changed files with 61 additions and 15 deletions
|
|
@ -15,6 +15,8 @@ struct driver *driver_register(const char *name, u32 type, void *init, void *dei
|
|||
|
||||
struct driver *driver = NULL;
|
||||
|
||||
list_lock(&pending_drivers);
|
||||
|
||||
list_item_t *item = pending_drivers.head;
|
||||
while (item) {
|
||||
struct driver *d = item->ptr;
|
||||
|
|
@ -26,6 +28,8 @@ struct driver *driver_register(const char *name, u32 type, void *init, void *dei
|
|||
item = item->next;
|
||||
}
|
||||
|
||||
list_unlock(&pending_drivers);
|
||||
|
||||
if (!driver) {
|
||||
driver = kzalloc(sizeof(struct driver), ALLOC_KERN);
|
||||
strncpy(driver->name, name, sizeof(driver->name) - 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue