Changeset 7beb220 in mainline for uspace/srv/devman/devman.c
- Timestamp:
- 2011-08-19T12:06:03Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2f2f1186
- Parents:
- d767cb1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
rd767cb1 r7beb220 920 920 } 921 921 922 /** Get list of device functions. */ 923 int dev_get_functions(dev_tree_t *tree, dev_node_t *dev, 924 devman_handle_t *hdl_buf, size_t buf_size, size_t *act_size) 925 { 926 size_t act_cnt; 927 size_t buf_cnt; 928 929 assert(fibril_rwlock_is_locked(&tree->rwlock)); 930 931 buf_cnt = buf_size / sizeof(devman_handle_t); 932 933 act_cnt = list_count(&dev->functions); 934 *act_size = act_cnt * sizeof(devman_handle_t); 935 936 if (buf_size % sizeof(devman_handle_t) != 0) 937 return EINVAL; 938 939 size_t pos = 0; 940 list_foreach(dev->functions, item) { 941 fun_node_t *fun = 942 list_get_instance(item, fun_node_t, dev_functions); 943 944 if (pos < buf_cnt) 945 hdl_buf[pos] = fun->handle; 946 pos++; 947 } 948 949 return EOK; 950 } 951 952 922 953 /* Function nodes */ 923 954 … … 1145 1176 char *rel_path = path; 1146 1177 char *next_path_elem = NULL; 1147 bool cont = true;1178 bool cont = (rel_path[1] != '\0'); 1148 1179 1149 1180 while (cont && fun != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.