Changes in uspace/lib/drv/generic/driver.c [b72efe8:9934f7d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/driver.c
rb72efe8 r9934f7d 139 139 find_interrupt_context_by_id(interrupt_context_list_t *list, int id) 140 140 { 141 fibril_mutex_lock(&list->mutex); 142 143 link_t *link = list->contexts.next; 141 144 interrupt_context_t *ctx; 142 145 143 fibril_mutex_lock(&list->mutex); 144 145 list_foreach(list->contexts, link) { 146 while (link != &list->contexts) { 146 147 ctx = list_get_instance(link, interrupt_context_t, link); 147 148 if (ctx->id == id) { … … 149 150 return ctx; 150 151 } 152 link = link->next; 151 153 } 152 154 … … 158 160 find_interrupt_context(interrupt_context_list_t *list, ddf_dev_t *dev, int irq) 159 161 { 162 fibril_mutex_lock(&list->mutex); 163 164 link_t *link = list->contexts.next; 160 165 interrupt_context_t *ctx; 161 166 162 fibril_mutex_lock(&list->mutex); 163 164 list_foreach(list->contexts, link) { 167 while (link != &list->contexts) { 165 168 ctx = list_get_instance(link, interrupt_context_t, link); 166 169 if (ctx->irq == irq && ctx->dev == dev) { … … 168 171 return ctx; 169 172 } 173 link = link->next; 170 174 } 171 175 … … 227 231 } 228 232 229 static ddf_fun_t *driver_get_function(li st_t *functions, devman_handle_t handle)233 static ddf_fun_t *driver_get_function(link_t *functions, devman_handle_t handle) 230 234 { 231 235 ddf_fun_t *fun = NULL; 232 236 233 237 fibril_mutex_lock(&functions_mutex); 234 235 list_foreach(*functions, link) { 238 link_t *link = functions->next; 239 240 while (link != functions) { 236 241 fun = list_get_instance(link, ddf_fun_t, link); 237 242 if (fun->handle == handle) { … … 239 244 return fun; 240 245 } 246 247 link = link->next; 241 248 } 242 249
Note:
See TracChangeset
for help on using the changeset viewer.