Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/port.c

    re882e3a rcae002c  
    3535
    3636#include <bool.h>
     37#include <devman.h>
    3738#include <errno.h>
    3839#include <str_error.h>
     
    287288        port->attached_device.fun = NULL;
    288289
    289         ret = usb_hub_unregister_device(&hub->usb_device->hc_conn,
    290             &port->attached_device);
    291         if (ret != EOK) {
    292                 usb_log_warning("Failed to unregister address of the "
    293                     "removed device: %s.\n", str_error(ret));
     290        ret = usb_hc_connection_open(&hub->connection);
     291        if (ret == EOK) {
     292                ret = usb_hc_unregister_device(&hub->connection,
     293                    port->attached_device.address);
     294                if (ret != EOK) {
     295                        usb_log_warning("Failed to unregister address of the "
     296                            "removed device: %s.\n", str_error(ret));
     297                }
     298                ret = usb_hc_connection_close(&hub->connection);
     299                if (ret != EOK) {
     300                        usb_log_warning("Failed to close hc connection %s.\n",
     301                            str_error(ret));
     302                }
     303
     304        } else {
     305                usb_log_warning("Failed to open hc connection %s.\n",
     306                    str_error(ret));
    294307        }
    295308
     
    425438
    426439        const int rc = usb_hc_new_device_wrapper(data->hub->usb_device->ddf_dev,
    427             &data->hub->usb_device->hc_conn, data->speed, enable_port_callback,
     440            &data->hub->connection, data->speed, enable_port_callback,
    428441            data->port, &new_address, NULL, NULL, &child_fun);
    429442
Note: See TracChangeset for help on using the changeset viewer.