Ignore:
File:
1 edited

Legend:

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

    rcae002c r344a0ac  
    401401{
    402402        usb_hub_port_t *port = arg;
    403         assert(port);
    404403        const int rc =
    405404            usb_hub_port_set_feature(port, USB_HUB_FEATURE_PORT_RESET);
     
    441440            data->port, &new_address, NULL, NULL, &child_fun);
    442441
    443         if (rc == EOK) {
    444                 fibril_mutex_lock(&data->port->mutex);
    445                 data->port->attached_device.fun = child_fun;
    446                 data->port->attached_device.address = new_address;
    447                 fibril_mutex_unlock(&data->port->mutex);
    448 
    449                 usb_log_info("Detected new device on `%s' (port %zu), "
    450                     "address %d (handle %" PRIun ").\n",
    451                     data->hub->usb_device->ddf_dev->name,
    452                     data->port->port_number, new_address, child_fun->handle);
    453         } else {
     442        if (rc != EOK) {
    454443                usb_log_error("Failed registering device on port %zu: %s.\n",
    455444                    data->port->port_number, str_error(rc));
    456         }
    457 
    458 
     445                goto leave;
     446        }
     447
     448        fibril_mutex_lock(&data->port->mutex);
     449        data->port->attached_device.fun = child_fun;
     450        data->port->attached_device.address = new_address;
     451        fibril_mutex_unlock(&data->port->mutex);
     452
     453        usb_log_info("Detected new device on `%s' (port %zu), "
     454            "address %d (handle %" PRIun ").\n",
     455            data->hub->usb_device->ddf_dev->name, data->port->port_number,
     456            new_address, child_fun->handle);
     457
     458leave:
    459459        fibril_mutex_lock(&data->hub->pending_ops_mutex);
    460460        assert(data->hub->pending_ops_count > 0);
Note: See TracChangeset for help on using the changeset viewer.