Changeset b4b534ac in mainline for uspace/app/usbinfo/main.c


Ignore:
Timestamp:
2016-07-22T08:24:47Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f76d2c2
Parents:
5b18137 (diff), 8351f9a4 (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 from lp:~jan.vesely/helenos/usb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/main.c

    r5b18137 rb4b534ac  
    4343#include <devman.h>
    4444#include <loc.h>
    45 #include <usb/hc.h>
    4645#include <usb/dev.h>
    4746#include <usb/dev/pipes.h>
     
    198197
    199198                /* The initialization is here only to make compiler happy. */
    200                 devman_handle_t hc_handle = 0;
    201                 usb_address_t dev_addr = 0;
    202                 int rc = usb_resolve_device_handle(devpath,
    203                     &hc_handle, &dev_addr, NULL);
     199                devman_handle_t handle = 0;
     200                int rc = usb_resolve_device_handle(devpath, &handle);
    204201                if (rc != EOK) {
    205202                        fprintf(stderr, NAME ": device `%s' not found "
     
    209206                }
    210207
    211                 usbinfo_device_t *dev = prepare_device(devpath,
    212                     hc_handle, dev_addr);
    213                 if (dev == NULL) {
     208                usb_device_t *usb_dev = usb_device_create(handle);
     209
     210                if (usb_dev == NULL) {
     211                        fprintf(stderr, NAME ": device `%s' not found "
     212                            "or not of USB kind, skipping.\n",
     213                            devpath);
    214214                        continue;
    215215                }
     
    221221                while (actions[action].opt != 0) {
    222222                        if (actions[action].active) {
    223                                 actions[action].action(dev);
     223                                actions[action].action(usb_dev);
    224224                        }
    225225                        action++;
    226226                }
    227227
    228                 /* Destroy the control pipe (close the session etc.). */
    229                 destroy_device(dev);
     228                usb_device_destroy(usb_dev);
    230229        }
    231230
Note: See TracChangeset for help on using the changeset viewer.