Changeset e0d8b740 in mainline for uspace/drv/bus/usb/uhci/hc.c


Ignore:
Timestamp:
2013-08-07T08:26:40Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6340a6ff
Parents:
cce3228
Message:

uhci: remove some more error handling macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/hc.c

    rcce3228 re0d8b740  
    208208{
    209209        assert(reg_size >= sizeof(uhci_regs_t));
    210         int ret;
    211 
    212 #define CHECK_RET_RETURN(ret, message...) \
    213         if (ret != EOK) { \
    214                 usb_log_error(message); \
    215                 return ret; \
    216         } else (void) 0
    217210
    218211        instance->hw_interrupts = interrupts;
     
    221214        /* allow access to hc control registers */
    222215        uhci_regs_t *io;
    223         ret = pio_enable(regs, reg_size, (void **)&io);
    224         CHECK_RET_RETURN(ret, "Failed to gain access to registers at %p: %s.\n",
    225             io, str_error(ret));
     216        int ret = pio_enable(regs, reg_size, (void **)&io);
     217        if (ret != EOK) {
     218                usb_log_error("Failed to gain access to registers at %p: %s.\n",
     219                    io, str_error(ret));
     220                return ret;
     221        }
    226222        instance->registers = io;
     223
    227224        usb_log_debug(
    228225            "Device registers at %p (%zuB) accessible.\n", io, reg_size);
    229226
    230227        ret = hc_init_mem_structures(instance);
    231         CHECK_RET_RETURN(ret,
    232             "Failed to initialize UHCI memory structures: %s.\n",
    233             str_error(ret));
    234 
    235 #undef CHECK_RET_RETURN
     228        if (ret != EOK) {
     229                usb_log_error("Failed to init UHCI memory structures: %s.\n",
     230                    str_error(ret));
     231                // TODO: we should disable pio here
     232                return ret;
     233        }
    236234
    237235        hc_init_hw(instance);
     
    391389
    392390        return EOK;
    393 #undef CHECK_RET_CLEAR_RETURN
    394391}
    395392
Note: See TracChangeset for help on using the changeset viewer.