diff options
author | Marvin Borner | 2021-06-19 13:12:34 +0200 |
---|---|---|
committer | Marvin Borner | 2021-06-19 13:12:34 +0200 |
commit | 73a55007a44d23be40be681c4882fd6ad1e30b60 (patch) | |
tree | 87f37dff42d8ae51dbb2250f1752a03081298cc3 /kernel/features/dev.c | |
parent | 02a0c882275959c0fbd58754418ecc1218821e76 (diff) |
Improved bus and device management
Diffstat (limited to 'kernel/features/dev.c')
-rw-r--r-- | kernel/features/dev.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/features/dev.c b/kernel/features/dev.c index ecc3f0c..0e082f9 100644 --- a/kernel/features/dev.c +++ b/kernel/features/dev.c @@ -63,6 +63,20 @@ static void dev_remove_group(u32 group) group_id--; } +void dev_remove_proc(struct proc *proc) +{ + for (u32 dev = DEV_MIN; dev < DEV_MAX; dev++) { + struct node *iterator = dev_listeners[dev]->head; + while (iterator) { + struct dev_listener *listener = iterator->data; + struct node *next = iterator->next; + if (listener->proc == proc) + list_remove(dev_listeners[dev], iterator); + iterator = next; + } + } +} + CLEAR void dev_add(enum dev_type type, struct dev_dev *dev) { assert(dev_type_valid(type) && !dev_mappings[type]); |