Changeset bda60d9 in mainline for uspace/lib/libdrv/include/driver.h


Ignore:
Timestamp:
2010-03-19T14:40:14Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d347b53
Parents:
7707954
Message:

adding child device - parts of code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libdrv/include/driver.h

    r7707954 rbda60d9  
    3737
    3838#include <adt/list.h>
     39#include <ipc/devman.h>
    3940
    4041typedef struct device {
    41         long handle;
     42        device_handle_t handle;
    4243        ipcarg_t parent_phone; 
     44        const char *name;
     45        match_id_list_t match_ids;
    4346       
    4447        // TODO add more items - parent bus type etc.
     
    6467        if (NULL != dev) {
    6568                memset(dev, 0, sizeof(device_t));
    66         }
    67        
     69        }       
     70        list_initialize(&dev->match_ids.ids);
    6871        return dev;
    6972}
    7073
    71 bool child_device_register(device_t *child, const char *child_name, device_t *parent);
     74static inline delete_device(device_t *dev) {
     75        clean_match_ids(&dev->match_ids);
     76        if (NULL != dev->name) {
     77                free(dev->name);
     78        }
     79        free(dev);
     80}
    7281
     82bool child_device_register(device_t *child, device_t *parent);
    7383
    7484
Note: See TracChangeset for help on using the changeset viewer.