Changes in uspace/drv/bus/usb/uhcirh/main.c [920d0fc:c53007f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhcirh/main.c
r920d0fc rc53007f 93 93 size_t io_size = 0; 94 94 uhci_root_hub_t *rh = NULL; 95 int r et = EOK;95 int rc; 96 96 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 } 102 103 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));106 104 usb_log_debug("I/O regs at %p (size %zuB).\n", 107 105 (void *) io_regs, io_size); 108 106 109 107 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 } 113 112 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 } 118 119 119 120 usb_log_info("Controlling root hub '%s' (%" PRIun ").\n", 120 121 ddf_dev_get_name(device), ddf_dev_get_handle(device)); 122 121 123 return EOK; 122 124 }
Note:
See TracChangeset
for help on using the changeset viewer.