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


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/usbmid
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbmid/dump.c

    rc1a966e ra1732929  
    5656                usb_standard_interface_descriptor_t *descriptor
    5757                    = (usb_standard_interface_descriptor_t *) data;
    58                 usb_log_info("Found interface: %s (0x%02x/0x%02x/0x%02x).\n",
     58                usb_log_info("Found interface: %s (0x%02x/0x%02x/0x%02x).",
    5959                    usb_str_class(descriptor->interface_class),
    6060                    (int) descriptor->interface_class,
  • uspace/drv/bus/usb/usbmid/explore.c

    rc1a966e ra1732929  
    106106
    107107
    108                 usb_log_info("Creating child for interface %d (%s).\n",
     108                usb_log_info("Creating child for interface %d (%s).",
    109109                    interface->interface_number,
    110110                    usb_str_class(interface->interface_class));
     
    144144                    dev_class, usb_str_class(dev_class),
    145145                    USB_CLASS_USE_INTERFACE);
    146                 usb_log_error("Not a multi-interface device, refusing.\n");
     146                usb_log_error("Not a multi-interface device, refusing.");
    147147                return ENOTSUP;
    148148        }
     
    160160            config_descriptor->configuration_number);
    161161        if (rc != EOK) {
    162                 usb_log_error("Failed to set device configuration: %s.\n",
     162                usb_log_error("Failed to set device configuration: %s.",
    163163                    str_error(rc));
    164164                return rc;
     
    168168        usb_mid_t *usb_mid = usb_device_data_alloc(dev, sizeof(usb_mid_t));
    169169        if (!usb_mid) {
    170                 usb_log_error("Failed to create USB MID structure.\n");
     170                usb_log_error("Failed to create USB MID structure.");
    171171                return ENOMEM;
    172172        }
     
    175175        usb_mid->ctl_fun = usb_device_ddf_fun_create(dev, fun_exposed, "ctl");
    176176        if (usb_mid->ctl_fun == NULL) {
    177                 usb_log_error("Failed to create control function.\n");
     177                usb_log_error("Failed to create control function.");
    178178                return ENOMEM;
    179179        }
     
    182182        rc = ddf_fun_bind(usb_mid->ctl_fun);
    183183        if (rc != EOK) {
    184                 usb_log_error("Failed to bind control function: %s.\n",
     184                usb_log_error("Failed to bind control function: %s.",
    185185                    str_error(rc));
    186186                ddf_fun_destroy(usb_mid->ctl_fun);
  • uspace/drv/bus/usb/usbmid/main.c

    rc1a966e ra1732929  
    5151static int usbmid_device_add(usb_device_t *dev)
    5252{
    53         usb_log_info("Taking care of new MID `%s'.\n", usb_device_get_name(dev));
     53        usb_log_info("Taking care of new MID `%s'.", usb_device_get_name(dev));
    5454
    5555        return usbmid_explore_device(dev);
     
    6868                const int pret = usbmid_interface_destroy(iface);
    6969                if (pret != EOK) {
    70                         usb_log_error("Failed to remove child `%s': %s\n",
     70                        usb_log_error("Failed to remove child `%s': %s",
    7171                            ddf_fun_get_name(iface->fun), str_error(pret));
    7272                        ret = pret;
     
    9191        int ret = ddf_fun_unbind(usb_mid->ctl_fun);
    9292        if (ret != EOK) {
    93                 usb_log_error("Failed to unbind USB MID ctl function: %s.\n",
     93                usb_log_error("Failed to unbind USB MID ctl function: %s.",
    9494                    str_error(ret));
    9595                return ret;
     
    9999        /* Remove all children */
    100100        list_foreach(usb_mid->interface_list, link, usbmid_interface_t, iface) {
    101                 usb_log_info("Removing child `%s'.\n",
     101                usb_log_info("Removing child `%s'.",
    102102                    ddf_fun_get_name(iface->fun));
    103103
     
    105105                int pret = ddf_fun_offline(iface->fun);
    106106                if (pret != EOK) {
    107                         usb_log_warning("Failed to turn off child `%s': %s\n",
     107                        usb_log_warning("Failed to turn off child `%s': %s",
    108108                            ddf_fun_get_name(iface->fun), str_error(pret));
    109109                        ret = pret;
     
    125125        assert(usb_mid);
    126126
    127         usb_log_info("USB MID gone: `%s'.\n", usb_device_get_name(dev));
     127        usb_log_info("USB MID gone: `%s'.", usb_device_get_name(dev));
    128128
    129129        /* Remove ctl function */
    130130        int ret = ddf_fun_unbind(usb_mid->ctl_fun);
    131131        if (ret != EOK) {
    132                 usb_log_error("Failed to unbind USB MID ctl function: %s.\n",
     132                usb_log_error("Failed to unbind USB MID ctl function: %s.",
    133133                    str_error(ret));
    134134                return ret;
Note: See TracChangeset for help on using the changeset viewer.