Changeset 5af21c5 in mainline for uspace/lib/libdrv/generic/driver.c
- Timestamp:
- 2010-04-23T13:40:39Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 953bc1ef
- Parents:
- df747b9c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libdrv/generic/driver.c
rdf747b9c r5af21c5 59 59 FIBRIL_MUTEX_INITIALIZE(devices_mutex); 60 60 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 70 61 static void add_to_devices_list(device_t *dev) 71 62 { … … 78 69 { 79 70 fibril_mutex_lock(&devices_mutex); 80 list_ append(&dev->link, &devices);71 list_remove(&dev->link); 81 72 fibril_mutex_unlock(&devices_mutex); 82 73 } … … 107 98 108 99 device_handle_t dev_handle = IPC_GET_ARG1(*icall); 109 device_t *dev = driver_create_device();100 device_t *dev = create_device(); 110 101 dev->handle = dev_handle; 111 102 … … 120 111 printf("%s: failed to add a new device with handle = %d.\n", driver->name, dev_handle); 121 112 remove_from_devices_list(dev); 122 delete_device(dev); 113 delete_device(dev); 123 114 } 124 115
Note:
See TracChangeset
for help on using the changeset viewer.