Changeset 557c7d0 in mainline for uspace/srv/devman/devman.c
- Timestamp:
- 2010-12-19T10:12:49Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8dd039a, f568ee7
- Parents:
- 11658b64 (diff), 40dc422 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
r11658b64 r557c7d0 62 62 } 63 63 64 static int devmap_devices_class_compare(unsigned long key[], hash_count_t keys, 65 link_t *item) 66 { 67 dev_class_info_t *class_info 68 = hash_table_get_instance(item, dev_class_info_t, devmap_link); 69 assert(class_info != NULL); 70 71 return (class_info->devmap_handle == (devmap_handle_t) key[0]); 72 } 73 64 74 static void devices_remove_callback(link_t *item) 65 75 { … … 75 85 .hash = devices_hash, 76 86 .compare = devmap_devices_compare, 87 .remove_callback = devices_remove_callback 88 }; 89 90 static hash_table_operations_t devmap_devices_class_ops = { 91 .hash = devices_hash, 92 .compare = devmap_devices_class_compare, 77 93 .remove_callback = devices_remove_callback 78 94 }; … … 678 694 } 679 695 680 devmap_device_register(devmap_pathname, &node->devmap_handle); 696 devmap_device_register_with_iface(devmap_pathname, 697 &node->devmap_handle, DEVMAN_CONNECT_FROM_DEVMAP); 681 698 682 699 tree_add_devmap_device(tree, node); … … 1050 1067 1051 1068 info = (dev_class_info_t *) malloc(sizeof(dev_class_info_t)); 1052 if (info != NULL) 1069 if (info != NULL) { 1053 1070 memset(info, 0, sizeof(dev_class_info_t)); 1071 list_initialize(&info->dev_classes); 1072 list_initialize(&info->devmap_link); 1073 list_initialize(&info->link); 1074 } 1054 1075 1055 1076 return info; … … 1175 1196 fibril_rwlock_initialize(&class_list->rwlock); 1176 1197 hash_table_create(&class_list->devmap_devices, DEVICE_BUCKETS, 1, 1177 &devmap_devices_ ops);1198 &devmap_devices_class_ops); 1178 1199 } 1179 1200 … … 1223 1244 hash_table_insert(&class_list->devmap_devices, &key, &cli->devmap_link); 1224 1245 fibril_rwlock_write_unlock(&class_list->rwlock); 1246 1247 assert(find_devmap_class_device(class_list, cli->devmap_handle) != NULL); 1225 1248 } 1226 1249
Note:
See TracChangeset
for help on using the changeset viewer.