Changeset 7969087 in mainline for uspace/app/devctl/devctl.c
- Timestamp:
- 2013-09-11T10:35:49Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 43dd8028
- Parents:
- e5556e4a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/devctl/devctl.c
re5556e4a r7969087 199 199 } 200 200 201 static int drv_load(const char *drvname) 202 { 203 int rc; 204 devman_handle_t drvh; 205 206 rc = devman_driver_get_handle(drvname, &drvh); 207 if (rc != EOK) { 208 printf("Failed resolving driver '%s' (%d).\n", drvname, rc); 209 return rc; 210 } 211 212 rc = devman_driver_load(drvh); 213 if (rc != EOK) { 214 printf("Failed loading driver '%s' (%d).\n", drvname, rc); 215 return rc; 216 } 217 218 return EOK; 219 } 220 201 221 static void print_syntax(void) 202 222 { … … 206 226 printf("\tdevctl offline <function>]\n"); 207 227 printf("\tdevctl list-drv\n"); 228 printf("\tdevctl load-drv <driver-name>\n"); 208 229 } 209 230 … … 242 263 if (rc != EOK) 243 264 return 2; 265 } else if (str_cmp(argv[1], "load-drv") == 0) { 266 if (argc < 3) { 267 printf(NAME ": Argument missing.\n"); 268 print_syntax(); 269 return 1; 270 } 271 272 rc = drv_load(argv[2]); 273 if (rc != EOK) 274 return 2; 244 275 } else { 245 276 printf(NAME ": Invalid argument '%s'.\n", argv[1]);
Note:
See TracChangeset
for help on using the changeset viewer.