Ignore:
File:
1 edited

Legend:

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

    r344a0ac rcae002c  
    401401{
    402402        usb_hub_port_t *port = arg;
     403        assert(port);
    403404        const int rc =
    404405            usb_hub_port_set_feature(port, USB_HUB_FEATURE_PORT_RESET);
     
    440441            data->port, &new_address, NULL, NULL, &child_fun);
    441442
    442         if (rc != EOK) {
     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 {
    443454                usb_log_error("Failed registering device on port %zu: %s.\n",
    444455                    data->port->port_number, str_error(rc));
    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 
    458 leave:
     456        }
     457
     458
    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.