Changeset 00aece0 in mainline for uspace/drv/infrastructure/root/root.c
- Timestamp:
- 2012-02-18T16:47:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4449c6c
- Parents:
- bd5f3b7 (diff), f943dd3 (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/drv/infrastructure/root/root.c
rbd5f3b7 r00aece0 66 66 #define VIRTUAL_FUN_MATCH_SCORE 100 67 67 68 static int root_add_device(ddf_dev_t *dev); 68 static int root_dev_add(ddf_dev_t *dev); 69 static int root_fun_online(ddf_fun_t *fun); 70 static int root_fun_offline(ddf_fun_t *fun); 69 71 70 72 /** The root device driver's standard operations. */ 71 73 static driver_ops_t root_ops = { 72 .add_device = &root_add_device 74 .dev_add = &root_dev_add, 75 .fun_online = &root_fun_online, 76 .fun_offline = &root_fun_offline 73 77 }; 74 78 … … 154 158 if (asprintf(&match_id, PLATFORM_FUN_MATCH_ID_FMT, platform) == -1) { 155 159 ddf_msg(LVL_ERROR, "Memory allocation failed."); 156 return ENOMEM; 157 } 160 free(platform); 161 return ENOMEM; 162 } 163 164 free(platform); 158 165 159 166 /* Add function. */ … … 165 172 if (fun == NULL) { 166 173 ddf_msg(LVL_ERROR, "Error creating function %s", name); 174 free(match_id); 167 175 return ENOMEM; 168 176 } … … 172 180 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s", 173 181 name); 182 free(match_id); 174 183 ddf_fun_destroy(fun); 175 184 return rc; … … 194 203 * of HW and pseudo devices). 195 204 */ 196 static int root_ add_device(ddf_dev_t *dev)197 { 198 ddf_msg(LVL_DEBUG, "root_ add_device, device handle=%" PRIun,205 static int root_dev_add(ddf_dev_t *dev) 206 { 207 ddf_msg(LVL_DEBUG, "root_dev_add, device handle=%" PRIun, 199 208 dev->handle); 200 209 … … 204 213 * vital for the system. 205 214 */ 206 add_virtual_root_fun(dev);215 (void) add_virtual_root_fun(dev); 207 216 208 217 /* Register root device's children. */ … … 214 223 } 215 224 225 static int root_fun_online(ddf_fun_t *fun) 226 { 227 ddf_msg(LVL_DEBUG, "root_fun_online()"); 228 return ddf_fun_online(fun); 229 } 230 231 static int root_fun_offline(ddf_fun_t *fun) 232 { 233 ddf_msg(LVL_DEBUG, "root_fun_offline()"); 234 return ddf_fun_offline(fun); 235 } 236 216 237 int main(int argc, char *argv[]) 217 238 {
Note:
See TracChangeset
for help on using the changeset viewer.