Changeset 729fa2d6 in mainline for uspace/srv/devman/devman.c


Ignore:
Timestamp:
2010-02-25T14:29:23Z (15 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
92413de
Parents:
924c75e1
Message:

parts of root device driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.c

    r924c75e1 r729fa2d6  
    348348       
    349349        fibril_mutex_lock(&drivers_list->drivers_mutex);
     350       
    350351        link_t *link = drivers_list->drivers.next;             
    351352        while (link != &drivers_list->drivers) {
     
    358359                link = link->next;
    359360        }
     361       
    360362        fibril_mutex_unlock(&drivers_list->drivers_mutex);
    361363       
     
    404406        drv->state = DRIVER_STARTING;
    405407        return true;
     408}
     409
     410driver_t * find_driver(driver_list_t *drv_list, const char *drv_name)
     411{       
     412        driver_t *res = NULL;
     413       
     414        fibril_mutex_lock(&drv_list->drivers_mutex);   
     415       
     416        driver_t *drv = NULL;
     417        link_t *link = drv_list->drivers.next; 
     418        while (link !=  &drv_list->drivers) {
     419                drv = list_get_instance(link, driver_t, drivers);
     420                if (0 == str_cmp(drv->name, drv_name)) {
     421                        res = drv;
     422                        break;
     423                }               
     424                link = link->next;
     425        }       
     426       
     427        fibril_mutex_unlock(&drv_list->drivers_mutex);
     428       
     429        return res;
    406430}
    407431
Note: See TracChangeset for help on using the changeset viewer.