Changeset cffa14e6 in mainline for uspace/drv/bus/usb/uhcirh/main.c
- Timestamp:
- 2013-07-24T17:27:56Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- db71e2a
- Parents:
- c442f63
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhcirh/main.c
rc442f63 rcffa14e6 93 93 size_t io_size = 0; 94 94 uhci_root_hub_t *rh = NULL; 95 int r c;95 int ret = EOK; 96 96 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 } 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 103 102 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)); 104 106 usb_log_debug("I/O regs at %p (size %zuB).\n", 105 107 (void *) io_regs, io_size); 106 108 107 109 rh = ddf_dev_data_alloc(device, sizeof(uhci_root_hub_t)); 108 if (rh == NULL) { 109 usb_log_error("Failed to allocate rh driver instance.\n"); 110 return ENOMEM; 111 } 110 ret = (rh == NULL) ? ENOMEM : EOK; 111 CHECK_RET_FREE_RH_RETURN(ret, 112 "Failed to allocate rh driver instance.\n"); 112 113 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 } 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)); 119 118 120 119 usb_log_info("Controlling root hub '%s' (%" PRIun ").\n", 121 120 ddf_dev_get_name(device), ddf_dev_get_handle(device)); 122 123 121 return EOK; 124 122 }
Note:
See TracChangeset
for help on using the changeset viewer.