Changeset e6b9182 in mainline for uspace/drv/bus/usb/ohci/main.c
- Timestamp:
- 2017-10-13T08:49:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 741bcdeb
- Parents:
- 0a5833d7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/main.c
r0a5833d7 re6b9182 45 45 46 46 #include "hc.h" 47 #include "ohci_bus.h" 47 48 48 49 #define NAME "ohci" … … 53 54 54 55 static const ddf_hc_driver_t ohci_hc_driver = { 55 .hc_speed = USB_SPEED_FULL,56 56 .irq_code_gen = ohci_hc_gen_irq_code, 57 57 .init = ohci_driver_init, … … 62 62 .ops = { 63 63 .schedule = ohci_hc_schedule, 64 .ep_add_hook = ohci_endpoint_init,65 .ep_remove_hook = ohci_endpoint_fini,66 64 .irq_hook = ohci_hc_interrupt, 67 65 .status_hook = ohci_hc_status, … … 72 70 static int ohci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res) 73 71 { 72 int err; 73 74 74 assert(hcd); 75 75 assert(hcd_get_driver_data(hcd) == NULL); … … 79 79 return ENOMEM; 80 80 81 const int ret = hc_init(instance, res); 82 if (ret == EOK) { 83 hcd_set_implementation(hcd, instance, &ohci_hc_driver.ops); 84 } else { 85 free(instance); 86 } 87 return ret; 81 if ((err = hc_init(instance, res)) != EOK) 82 goto err; 83 84 if ((err = ohci_bus_init(&instance->bus, instance))) 85 goto err; 86 87 hcd_set_implementation(hcd, instance, &ohci_hc_driver.ops, &instance->bus.base.base); 88 89 return EOK; 90 91 err: 92 free(instance); 93 return err; 88 94 } 89 95 … … 115 121 hc_fini(hc); 116 122 117 hcd_set_implementation(hcd, NULL, NULL );123 hcd_set_implementation(hcd, NULL, NULL, NULL); 118 124 free(hc); 119 125 }
Note:
See TracChangeset
for help on using the changeset viewer.