Changeset a32defa in mainline for uspace/srv/devman/main.c


Ignore:
Timestamp:
2010-06-01T20:53:07Z (15 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a6e54c5d
Parents:
ce89036b
Message:

Register devices in the device tree by the device mapper so the device hierarchy can be seen from devfs.

File:
1 edited

Legend:

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

    rce89036b ra32defa  
    240240       
    241241        // try to find suitable driver and assign it to the device
    242         assign_driver(node, &drivers_list);     
     242        assign_driver(node, &drivers_list, &device_tree);       
    243243}
    244244
     
    247247        // create devmap path and name for the device
    248248        char *devmap_pathname = NULL;
    249         asprintf(&devmap_pathname, "%s/%s%s%s", DEVMAP_CLASS_NAMESPACE, cli->dev_class->name, DEVMAP_SEPARATOR, cli->dev_name);
     249        asprintf(&devmap_pathname, "%s/%s%c%s", DEVMAP_CLASS_NAMESPACE, cli->dev_class->name, DEVMAP_SEPARATOR, cli->dev_name);
    250250        if (NULL == devmap_pathname) {
    251251                return;
     
    254254        // register the device by the device mapper and remember its devmap handle
    255255        devmap_device_register(devmap_pathname, &cli->devmap_handle);   
     256       
     257        // add device to the hash map of class devices registered by device mapper
     258        class_add_devmap_device(&class_list, cli);
    256259       
    257260        free(devmap_pathname); 
     
    297300{
    298301        driver_t *driver = (driver_t *)drv;
    299         initialize_running_driver(driver);     
     302        initialize_running_driver(driver, &device_tree);       
    300303        printf(NAME ": the %s driver was successfully initialized. \n", driver->name);
    301304        return 0;
Note: See TracChangeset for help on using the changeset viewer.