Changeset bf6b7c6 in mainline
- Timestamp:
- 2013-09-21T03:54:03Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 30e8ab4
- Parents:
- ea69749f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci.c
rea69749f rbf6b7c6 91 91 hw_res_list_parsed_clean(&hw_res); 92 92 93 94 93 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d.\n", 95 94 RNGABSPTR(regs), RNGSZ(regs), irq); … … 99 98 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 100 99 if (ret != EOK) { 101 usb_log_error("Failed d to setup generic hcd: %s.",100 usb_log_error("Failed to setup generic hcd structures: %s.", 102 101 str_error(ret)); 103 102 return ret; … … 108 107 usb_log_error("Failed to register interrupt handler: %s.\n", 109 108 str_error(ret)); 110 hcd_ddf_clean_hc(device); 111 return ret; 109 goto ddf_hc_clean; 112 110 } 113 111 … … 125 123 } 126 124 127 128 hc_t *hc_impl = malloc(sizeof(hc_t)); 129 if (!hc_impl) { 125 hc_t *hc = malloc(sizeof(hc_t)); 126 if (!hc) { 130 127 usb_log_error("Failed to allocate driver structure.\n"); 131 hcd_ddf_clean_hc(device); 132 unregister_interrupt_handler(device, irq); 133 return ENOMEM; 128 ret = ENOMEM; 129 goto unregister_irq; 134 130 } 135 131 136 132 /* Initialize OHCI HC */ 137 ret = hc_init(hc _impl, ®s, interrupts);133 ret = hc_init(hc, ®s, interrupts); 138 134 if (ret != EOK) { 139 135 usb_log_error("Failed to init hc: %s.\n", str_error(ret)); 140 hcd_ddf_clean_hc(device); 141 unregister_interrupt_handler(device, irq); 142 return ret; 136 goto hc_free; 143 137 } 144 138 145 139 /* Connect OHCI to generic HCD */ 146 hcd_set_implementation(dev_to_hcd(device), hc _impl,140 hcd_set_implementation(dev_to_hcd(device), hc, 147 141 hc_schedule, ohci_endpoint_init, ohci_endpoint_fini); 148 142 … … 150 144 ret = hcd_ddf_setup_root_hub(device); 151 145 if (ret != EOK) { 152 usb_log_error("Failed to regist ter OHCI root hub: %s.\n",146 usb_log_error("Failed to register OHCI root hub: %s.\n", 153 147 str_error(ret)); 148 hc_fini(hc); 149 hc_free: 150 free(hc); 151 unregister_irq: 152 unregister_interrupt_handler(device, irq); 153 ddf_hc_clean: 154 154 hcd_ddf_clean_hc(device); 155 unregister_interrupt_handler(device, irq);156 return ret;157 155 } 158 159 156 return ret; 160 157 }
Note:
See TracChangeset
for help on using the changeset viewer.