Changeset 772a172 in mainline for uspace/drv/bus/usb/ohci/ohci.c
- Timestamp:
- 2013-09-21T05:22:43Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f65d9cc
- Parents:
- 19d21728
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci.c
r19d21728 r772a172 103 103 } 104 104 105 ret = hc_register_irq_handler(device, ®s, irq, irq_handler);106 if ( ret != EOK) {107 usb_log_error("Failed to register interrupt handler: %s.\n",108 str_error(ret));105 hc_t *hc = malloc(sizeof(hc_t)); 106 if (!hc) { 107 usb_log_error("Failed to allocate driver structure.\n"); 108 ret = ENOMEM; 109 109 goto ddf_hc_clean; 110 110 } … … 112 112 /* Try to enable interrupts */ 113 113 bool interrupts = false; 114 ret = hcd_ddf_enable_interrupts(device); 114 ret = hcd_ddf_setup_interrupts(device, ®s, irq, irq_handler, 115 hc_gen_irq_code); 115 116 if (ret != EOK) { 116 117 usb_log_warning("Failed to enable interrupts: %s." … … 123 124 } 124 125 125 hc_t *hc = malloc(sizeof(hc_t));126 if (!hc) {127 usb_log_error("Failed to allocate driver structure.\n");128 ret = ENOMEM;129 goto unregister_irq;130 }131 132 126 /* Initialize OHCI HC */ 133 127 ret = hc_init(hc, ®s, interrupts); 134 128 if (ret != EOK) { 135 129 usb_log_error("Failed to init hc: %s.\n", str_error(ret)); 136 goto hc_free;130 goto unregister_irq; 137 131 } 138 132 … … 147 141 str_error(ret)); 148 142 hc_fini(hc); 149 hc_free:150 free(hc);151 143 unregister_irq: 152 144 unregister_interrupt_handler(device, irq); 145 free(hc); 153 146 ddf_hc_clean: 154 147 hcd_ddf_clean_hc(device);
Note:
See TracChangeset
for help on using the changeset viewer.