Changeset 5af21c5 in mainline


Ignore:
Timestamp:
2010-04-23T13:40:39Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
953bc1ef
Parents:
df747b9c
Message:

fixed a bug

Location:
uspace/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/ipc/devman.h

    rdf747b9c r5af21c5  
    3737#include <ipc/ipc.h>
    3838#include <stdlib.h>
     39#include <stdio.h>
    3940#include <string.h>
    4041
     
    100101}
    101102
     103static inline void init_match_ids(match_id_list_t *id_list)
     104{
     105        list_initialize(&id_list->ids);
     106}
     107
    102108static inline void clean_match_ids(match_id_list_t *ids)
    103109{
  • uspace/lib/libdrv/generic/driver.c

    rdf747b9c r5af21c5  
    5959FIBRIL_MUTEX_INITIALIZE(devices_mutex);
    6060
    61 static device_t * driver_create_device()
    62 {
    63         device_t *dev = (device_t *)malloc(sizeof(device_t));
    64         if (NULL != dev) {
    65                 memset(dev, 0, sizeof(device_t));
    66         }
    67         return dev;
    68 }
    69 
    7061static void add_to_devices_list(device_t *dev)
    7162{
     
    7869{
    7970        fibril_mutex_lock(&devices_mutex);
    80         list_append(&dev->link, &devices);
     71        list_remove(&dev->link);
    8172        fibril_mutex_unlock(&devices_mutex);
    8273}
     
    10798       
    10899        device_handle_t dev_handle =  IPC_GET_ARG1(*icall);
    109         device_t *dev = driver_create_device();
     100        device_t *dev = create_device();
    110101        dev->handle = dev_handle;
    111102       
     
    120111                printf("%s: failed to add a new device with handle = %d.\n", driver->name, dev_handle);
    121112                remove_from_devices_list(dev);
    122                 delete_device(dev);            
     113                delete_device(dev);     
    123114        }
    124115       
  • uspace/lib/libdrv/include/driver.h

    rdf747b9c r5af21c5  
    121121} driver_t;
    122122
    123 
    124 
    125 
    126 
    127123int driver_main(driver_t *drv);
    128124
     
    136132        if (NULL != dev) {
    137133                memset(dev, 0, sizeof(device_t));
    138         }
    139         list_initialize(&dev->match_ids.ids);
     134                init_match_ids(&dev->match_ids);
     135        }       
    140136        return dev;
    141137}
Note: See TracChangeset for help on using the changeset viewer.