Changeset e160bfe8 in mainline for uspace/app/devctl/devctl.c


Ignore:
Timestamp:
2017-10-23T18:51:34Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
327f147
Parents:
31cca4f3 (diff), 367db39a (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.
Message:

merge mainline (again) to fix build

Perhaps it wasn't so good idea to start merging mainline in these unstable times :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/devctl/devctl.c

    r31cca4f3 re160bfe8  
    337337}
    338338
     339static int drv_unload(const char *drvname)
     340{
     341        int rc;
     342        devman_handle_t drvh;
     343
     344        rc = devman_driver_get_handle(drvname, &drvh);
     345        if (rc != EOK) {
     346                printf("Failed resolving driver '%s' (%d).\n", drvname, rc);
     347                return rc;
     348        }
     349
     350        rc = devman_driver_unload(drvh);
     351        if (rc != EOK) {
     352                printf("Failed unloading driver '%s' (%d).\n", drvname, rc);
     353                return rc;
     354        }
     355
     356        return EOK;
     357}
     358
    339359static void print_syntax(void)
    340360{
     
    346366        printf("\tdevctl show-drv <driver-name>\n");
    347367        printf("\tdevctl load-drv <driver-name>\n");
     368        printf("\tdevctl unload-drv <driver-name>\n");
    348369}
    349370
     
    412433                if (rc != EOK)
    413434                        return 2;
     435        } else if (str_cmp(argv[1], "unload-drv") == 0) {
     436                if (argc < 3) {
     437                        printf(NAME ": Argument missing.\n");
     438                        print_syntax();
     439                        return 1;
     440                }
     441
     442                rc = drv_unload(argv[2]);
     443                if (rc != EOK)
     444                        return 2;
    414445        } else {
    415446                printf(NAME ": Invalid argument '%s'.\n", argv[1]);
Note: See TracChangeset for help on using the changeset viewer.