Changeset a1732929 in mainline for uspace/drv/bus/usb/ehci/res.c


Ignore:
Timestamp:
2018-01-15T17:04:34Z (6 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/res.c

    rc1a966e ra1732929  
    7474            eecp + USBLEGSUP_OFFSET, &usblegsup);
    7575        if (ret != EOK) {
    76                 usb_log_error("Failed to read USBLEGSUP: %s.\n", str_error(ret));
    77                 return ret;
    78         }
    79         usb_log_debug2("USBLEGSUP: %" PRIx32 ".\n", usblegsup);
     76                usb_log_error("Failed to read USBLEGSUP: %s.", str_error(ret));
     77                return ret;
     78        }
     79        usb_log_debug2("USBLEGSUP: %" PRIx32 ".", usblegsup);
    8080
    8181        /* Request control from firmware/BIOS by writing 1 to highest
    8282         * byte. (OS Control semaphore)*/
    83         usb_log_debug("Requesting OS control.\n");
     83        usb_log_debug("Requesting OS control.");
    8484        ret = pci_config_space_write_8(parent_sess,
    8585            eecp + USBLEGSUP_OFFSET + 3, 1);
    8686        if (ret != EOK) {
    87                 usb_log_error("Failed to request OS EHCI control: %s.\n",
     87                usb_log_error("Failed to request OS EHCI control: %s.",
    8888                    str_error(ret));
    8989                return ret;
     
    103103
    104104        if ((usblegsup & USBLEGSUP_BIOS_CONTROL) == 0) {
    105                 usb_log_info("BIOS released control after %zu usec.\n", wait);
     105                usb_log_info("BIOS released control after %zu usec.", wait);
    106106                return EOK;
    107107        }
     
    109109        /* BIOS failed to hand over control, this should not happen. */
    110110        usb_log_warning( "BIOS failed to release control after "
    111             "%zu usecs, force it.\n", wait);
     111            "%zu usecs, force it.", wait);
    112112        ret = pci_config_space_write_32(parent_sess,
    113113            eecp + USBLEGSUP_OFFSET, USBLEGSUP_OS_CONTROL);
    114114        if (ret != EOK) {
    115                 usb_log_error("Failed to force OS control: %s.\n",
     115                usb_log_error("Failed to force OS control: %s.",
    116116                    str_error(ret));
    117117                return ret;
     
    130130                    eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts);
    131131                if (ret != EOK) {
    132                         usb_log_error("Failed to get USBLEGCTLSTS: %s.\n",
     132                        usb_log_error("Failed to get USBLEGCTLSTS: %s.",
    133133                            str_error(ret));
    134134                        return ret;
    135135                }
    136                 usb_log_debug2("USBLEGCTLSTS: %" PRIx32 ".\n", usblegctlsts);
     136                usb_log_debug2("USBLEGCTLSTS: %" PRIx32 ".", usblegctlsts);
    137137                /*
    138138                 * Zero SMI enables in legacy control register.
     
    143143                    eecp + USBLEGCTLSTS_OFFSET, 0xe0000000);
    144144                if (ret != EOK) {
    145                         usb_log_error("Failed to zero USBLEGCTLSTS: %s\n",
     145                        usb_log_error("Failed to zero USBLEGCTLSTS: %s",
    146146                            str_error(ret));
    147147                        return ret;
     
    153153                    eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts);
    154154                if (ret != EOK) {
    155                         usb_log_error("Failed to get USBLEGCTLSTS 2: %s.\n",
     155                        usb_log_error("Failed to get USBLEGCTLSTS 2: %s.",
    156156                            str_error(ret));
    157157                        return ret;
    158158                }
    159                 usb_log_debug2("Zeroed USBLEGCTLSTS: %" PRIx32 ".\n",
     159                usb_log_debug2("Zeroed USBLEGCTLSTS: %" PRIx32 ".",
    160160                    usblegctlsts);
    161161        }
     
    165165            eecp + USBLEGSUP_OFFSET, &usblegsup);
    166166        if (ret != EOK) {
    167                 usb_log_error("Failed to read USBLEGSUP: %s.\n",
    168                     str_error(ret));
    169                 return ret;
    170         }
    171         usb_log_debug2("USBLEGSUP: %" PRIx32 ".\n", usblegsup);
     167                usb_log_error("Failed to read USBLEGSUP: %s.",
     168                    str_error(ret));
     169                return ret;
     170        }
     171        usb_log_debug2("USBLEGSUP: %" PRIx32 ".", usblegsup);
    172172        return ret;
    173173}
     
    181181                return ENOMEM;
    182182
    183         usb_log_debug("Disabling EHCI legacy support.\n");
     183        usb_log_debug("Disabling EHCI legacy support.");
    184184
    185185
    186186        const uint32_t hcc_params = EHCI_RD(hc->caps->hccparams);
    187         usb_log_debug2("Value of hcc params register: %x.\n", hcc_params);
     187        usb_log_debug2("Value of hcc params register: %x.", hcc_params);
    188188
    189189        /* Read value of EHCI Extended Capabilities Pointer
     
    191191        const uint32_t eecp =
    192192            (hcc_params >> EHCI_CAPS_HCC_EECP_SHIFT) & EHCI_CAPS_HCC_EECP_MASK;
    193         usb_log_debug2("Value of EECP: %x.\n", eecp);
     193        usb_log_debug2("Value of EECP: %x.", eecp);
    194194
    195195        int ret = disable_extended_caps(parent_sess, eecp);
    196196        if (ret != EOK) {
    197                 usb_log_error("Failed to disable extended capabilities: %s.\n",
     197                usb_log_error("Failed to disable extended capabilities: %s.",
    198198                    str_error(ret));
    199199                    goto clean;
Note: See TracChangeset for help on using the changeset viewer.