Changeset 3842a955 in mainline for uspace/lib/drv/generic/driver.c


Ignore:
Timestamp:
2011-06-19T15:59:42Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
26e7d6d
Parents:
9724d7f (diff), 74464e8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/driver.c

    r9724d7f r3842a955  
    139139find_interrupt_context_by_id(interrupt_context_list_t *list, int id)
    140140{
     141        interrupt_context_t *ctx;
     142       
    141143        fibril_mutex_lock(&list->mutex);
    142144       
    143         link_t *link = list->contexts.next;
    144         interrupt_context_t *ctx;
    145        
    146         while (link != &list->contexts) {
     145        list_foreach(list->contexts, link) {
    147146                ctx = list_get_instance(link, interrupt_context_t, link);
    148147                if (ctx->id == id) {
     
    150149                        return ctx;
    151150                }
    152                 link = link->next;
    153151        }
    154152       
     
    160158find_interrupt_context(interrupt_context_list_t *list, ddf_dev_t *dev, int irq)
    161159{
     160        interrupt_context_t *ctx;
     161       
    162162        fibril_mutex_lock(&list->mutex);
    163163       
    164         link_t *link = list->contexts.next;
    165         interrupt_context_t *ctx;
    166        
    167         while (link != &list->contexts) {
     164        list_foreach(list->contexts, link) {
    168165                ctx = list_get_instance(link, interrupt_context_t, link);
    169166                if (ctx->irq == irq && ctx->dev == dev) {
     
    171168                        return ctx;
    172169                }
    173                 link = link->next;
    174170        }
    175171       
     
    231227}
    232228
    233 static ddf_fun_t *driver_get_function(link_t *functions, devman_handle_t handle)
     229static ddf_fun_t *driver_get_function(list_t *functions, devman_handle_t handle)
    234230{
    235231        ddf_fun_t *fun = NULL;
    236232       
    237233        fibril_mutex_lock(&functions_mutex);
    238         link_t *link = functions->next;
    239        
    240         while (link != functions) {
     234       
     235        list_foreach(*functions, link) {
    241236                fun = list_get_instance(link, ddf_fun_t, link);
    242237                if (fun->handle == handle) {
     
    244239                        return fun;
    245240                }
    246                
    247                 link = link->next;
    248241        }
    249242       
Note: See TracChangeset for help on using the changeset viewer.