Changeset 224174f in mainline for uspace/drv/bus/usb/uhcirh/main.c


Ignore:
Timestamp:
2013-07-11T13:16:57Z (11 years ago)
Author:
Manuele Conti <conti.ma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2b3e8840, b2c96093
Parents:
990ab7d (diff), 3a67d63 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes

File:
1 edited

Legend:

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

    r990ab7d r224174f  
    9393        size_t io_size = 0;
    9494        uhci_root_hub_t *rh = NULL;
    95         int ret = EOK;
     95        int rc;
    9696
    97 #define CHECK_RET_FREE_RH_RETURN(ret, message...) \
    98 if (ret != EOK) { \
    99         usb_log_error(message); \
    100         return ret; \
    101 } else (void)0
     97        rc = hc_get_my_registers(device, &io_regs, &io_size);
     98        if (rc != EOK) {
     99                usb_log_error( "Failed to get registers from HC: %s.\n",
     100                    str_error(rc));
     101                return rc;
     102        }
    102103
    103         ret = hc_get_my_registers(device, &io_regs, &io_size);
    104         CHECK_RET_FREE_RH_RETURN(ret,
    105             "Failed to get registers from HC: %s.\n", str_error(ret));
    106104        usb_log_debug("I/O regs at %p (size %zuB).\n",
    107105            (void *) io_regs, io_size);
    108106
    109107        rh = ddf_dev_data_alloc(device, sizeof(uhci_root_hub_t));
    110         ret = (rh == NULL) ? ENOMEM : EOK;
    111         CHECK_RET_FREE_RH_RETURN(ret,
    112             "Failed to allocate rh driver instance.\n");
     108        if (rh == NULL) {
     109                usb_log_error("Failed to allocate rh driver instance.\n");
     110                return ENOMEM;
     111        }
    113112
    114         ret = uhci_root_hub_init(rh, (void*)io_regs, io_size, device);
    115         CHECK_RET_FREE_RH_RETURN(ret,
    116             "Failed(%d) to initialize rh driver instance: %s.\n",
    117             ret, str_error(ret));
     113        rc = uhci_root_hub_init(rh, (void*)io_regs, io_size, device);
     114        if (rc != EOK) {
     115                usb_log_error("Failed(%d) to initialize rh driver instance: "
     116                    "%s.\n", rc, str_error(rc));
     117                return rc;
     118        }
    118119
    119120        usb_log_info("Controlling root hub '%s' (%" PRIun ").\n",
    120121            ddf_dev_get_name(device), ddf_dev_get_handle(device));
     122
    121123        return EOK;
    122124}
Note: See TracChangeset for help on using the changeset viewer.