Changeset a1732929 in mainline for uspace/drv/bus/usb/vhc


Ignore:
Timestamp:
2018-01-15T17:04:34Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9ff99e8
Parents:
c1a966e
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:32)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:34)
Message:

usb: unified logging

Use logger instead of printf. Logger adds newlines automatically.

Location:
uspace/drv/bus/usb/vhc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/vhc/conndev.c

    rc1a966e ra1732929  
    113113                receive_device_name(callback);
    114114               
    115                 usb_log_info("New virtual device `%s' (id: %" PRIxn ").\n",
     115                usb_log_info("New virtual device `%s' (id: %" PRIxn ").",
    116116                    plugged_device_name, plugged_device_handle);
    117117        } else
     
    130130
    131131        if (plugged_device_handle != 0) {
    132                 usb_log_info("Virtual device `%s' disconnected (id: %" PRIxn ").\n",
     132                usb_log_info("Virtual device `%s' disconnected (id: %" PRIxn ").",
    133133                    plugged_device_name, plugged_device_handle);
    134134                vhc_virtdev_unplug(vhc, plugged_device_handle);
  • uspace/drv/bus/usb/vhc/hub/hub.c

    rc1a966e ra1732929  
    231231        }
    232232
    233         usb_log_debug("Setting port %zu to state %d.\n", port_index, state);
     233        usb_log_debug("Setting port %zu to state %d.", port_index, state);
    234234
    235235        switch (state) {
     
    423423        uint16_t old_value = port->status_change;
    424424        port->status_change |= change;
    425         usb_log_debug("Changing status change on %zu: %04x => %04x\n",
     425        usb_log_debug("Changing status change on %zu: %04x => %04x",
    426426            port->index,
    427427            (unsigned int) old_value, (unsigned int) port->status_change);
     
    510510        fid_t fibril = fibril_create(set_port_state_delayed_fibril, change);
    511511        if (fibril == 0) {
    512                 printf("Failed to create fibril\n");
     512                usb_log_error("Failed to create fibril.");
    513513                free(change);
    514514                return;
  • uspace/drv/bus/usb/vhc/main.c

    rc1a966e ra1732929  
    7777        int ret = hcd_ddf_setup_hc(dev, sizeof(vhc_data_t));
    7878        if (ret != EOK) {
    79                 usb_log_error("Failed to init HCD structures: %s.\n",
     79                usb_log_error("Failed to init HCD structures: %s.",
    8080                   str_error(ret));
    8181                return ret;
     
    9090        ret = vhc_control_node(dev, &ctl_fun);
    9191        if (ret != EOK) {
    92                 usb_log_error("Failed to setup control node.\n");
     92                usb_log_error("Failed to setup control node.");
    9393                return ret;
    9494        }
     
    9797        ret = vhc_virtdev_plug_hub(vhc, &vhc->hub, NULL, 0);
    9898        if (ret != EOK) {
    99                 usb_log_error("Failed to plug root hub: %s.\n", str_error(ret));
     99                usb_log_error("Failed to plug root hub: %s.", str_error(ret));
    100100                ddf_fun_destroy(ctl_fun);
    101101                return ret;
     
    108108        ret = hcd_setup_virtual_root_hub(&vhc->base);
    109109        if (ret != EOK) {
    110                 usb_log_error("Failed to init VHC root hub: %s\n",
     110                usb_log_error("Failed to init VHC root hub: %s",
    111111                        str_error(ret));
    112112                // TODO do something here...
  • uspace/drv/bus/usb/vhc/transfer.c

    rc1a966e ra1732929  
    207207       
    208208        if (targets > 1)
    209                 usb_log_warning("Transfer would be accepted by more devices!\n");
     209                usb_log_warning("Transfer would be accepted by more devices!");
    210210
    211211        return targets ? EOK : ENOENT;
     
    236236                            dev->dev_local, &data_transfer_size);
    237237                } else {
    238                         usb_log_warning("Device has no remote phone nor local node.\n");
     238                        usb_log_warning("Device has no remote phone nor local node.");
    239239                        rc = ESTALL;
    240240                }
    241241
    242                 usb_log_debug2("Transfer %p processed: %s.\n",
     242                usb_log_debug2("Transfer %p processed: %s.",
    243243                    transfer, str_error(rc));
    244244
     
    249249                                    (void*) transfer->batch.setup.buffer;
    250250                                dev->address = setup->value;
    251                                 usb_log_debug2("Address changed to %d\n",
     251                                usb_log_debug2("Address changed to %d",
    252252                                    dev->address);
    253253                        }
Note: See TracChangeset for help on using the changeset viewer.