Changeset 7be3638 in mainline


Ignore:
Timestamp:
2011-10-12T18:19:01Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
844f4ef
Parents:
96fde65
Message:

uhcirh: Handle ghost device removal, improve output.

File:
1 edited

Legend:

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

    r96fde65 r7be3638  
    285285int uhci_port_remove_device(uhci_port_t *port)
    286286{
    287         usb_log_debug("Removing device on port %zu.\n", port->number);
     287        assert(port);
     288        /* There is nothing to remove. */
     289        if (port->attached_device.handle == 0) {
     290                usb_log_warning("%s: Removed a ghost device.\n",
     291                    port->id_string);
     292                assert(port->attached_device.address == -1);
     293                return EOK;
     294        }
     295
     296        usb_log_debug("%s: Removing device.\n", port->id_string);
    288297
    289298        /* Stop driver first */
    290299        int ret = devman_remove_function(port->attached_device.handle);
    291300        if (ret != EOK) {
    292                 usb_log_error("Failed to remove child function on port"
    293                    " %zu: %s.\n", port->number, str_error(ret));
     301                usb_log_error("%s: Failed to remove child function: %s.\n",
     302                   port->id_string, str_error(ret));
    294303                return ret;
    295304        }
     
    300309            port->attached_device.address);
    301310        if (ret != EOK) {
    302                 usb_log_error("Failed to unregister address of removed device: "
    303                     "%s.\n", str_error(ret));
     311                usb_log_error("%s: Failed to unregister address of removed "
     312                    "device: %s.\n", port->id_string, str_error(ret));
    304313                return ret;
    305314        }
    306 
    307315        port->attached_device.address = -1;
    308         usb_log_info("Removed device on port %zu.\n", port->number);
     316
     317        usb_log_info("%s: Removed attached device.\n", port->id_string);
    309318        return EOK;
    310319}
Note: See TracChangeset for help on using the changeset viewer.