Changeset 5af21c5 in mainline
- Timestamp:
- 2010-04-23T13:40:39Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 953bc1ef
- Parents:
- df747b9c
- Location:
- uspace/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/ipc/devman.h
rdf747b9c r5af21c5 37 37 #include <ipc/ipc.h> 38 38 #include <stdlib.h> 39 #include <stdio.h> 39 40 #include <string.h> 40 41 … … 100 101 } 101 102 103 static inline void init_match_ids(match_id_list_t *id_list) 104 { 105 list_initialize(&id_list->ids); 106 } 107 102 108 static inline void clean_match_ids(match_id_list_t *ids) 103 109 { -
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 -
uspace/lib/libdrv/include/driver.h
rdf747b9c r5af21c5 121 121 } driver_t; 122 122 123 124 125 126 127 123 int driver_main(driver_t *drv); 128 124 … … 136 132 if (NULL != dev) { 137 133 memset(dev, 0, sizeof(device_t)); 138 }139 list_initialize(&dev->match_ids.ids);134 init_match_ids(&dev->match_ids); 135 } 140 136 return dev; 141 137 }
Note:
See TracChangeset
for help on using the changeset viewer.