Changeset 1d5a540 in mainline for uspace/drv/bus/usb/ohci/ohci.c
- Timestamp:
- 2012-08-17T11:52:20Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 034c4202
- Parents:
- 8312577 (diff), 56fd7cf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci.c
r8312577 r1d5a540 33 33 * @brief OHCI driver 34 34 */ 35 36 /* XXX Fix this */ 37 #define _DDF_DATA_IMPLANT 38 35 39 #include <errno.h> 36 40 #include <str_error.h> … … 52 56 } ohci_t; 53 57 54 static inline ohci_t * dev_to_ohci(ddf_dev_t *dev) 55 { 56 assert(dev); 57 return dev->driver_data; 58 static inline ohci_t *dev_to_ohci(ddf_dev_t *dev) 59 { 60 return ddf_dev_data_get(dev); 58 61 } 59 62 /** IRQ handling callback, identifies device … … 87 90 88 91 if (address != NULL) { 89 *address = dev_to_ohci( fun->dev)->hc.rh.address;92 *address = dev_to_ohci(ddf_fun_get_dev(fun))->hc.rh.address; 90 93 } 91 94 … … 103 106 { 104 107 assert(fun); 105 ddf_fun_t *hc_fun = dev_to_ohci( fun->dev)->hc_fun;108 ddf_fun_t *hc_fun = dev_to_ohci(ddf_fun_get_dev(fun))->hc_fun; 106 109 assert(hc_fun); 107 110 108 111 if (handle != NULL) 109 *handle = hc_fun->handle;112 *handle = ddf_fun_get_handle(hc_fun); 110 113 return EOK; 111 114 } … … 152 155 if (ret != EOK) { \ 153 156 if (instance->hc_fun) { \ 154 instance->hc_fun->driver_data = NULL; \155 157 ddf_fun_destroy(instance->hc_fun); \ 156 158 } \ 157 159 if (instance->rh_fun) { \ 158 instance->rh_fun->driver_data = NULL; \159 160 ddf_fun_destroy(instance->rh_fun); \ 160 161 } \ … … 167 168 CHECK_RET_DEST_FREE_RETURN(ret, 168 169 "Failed to create OHCI HC function: %s.\n", str_error(ret)); 169 instance->hc_fun->ops = &hc_ops;170 instance->hc_fun->driver_data = &instance->hc;170 ddf_fun_set_ops(instance->hc_fun, &hc_ops); 171 ddf_fun_data_implant(instance->hc_fun, &instance->hc); 171 172 172 173 instance->rh_fun = ddf_fun_create(device, fun_inner, "ohci_rh"); … … 174 175 CHECK_RET_DEST_FREE_RETURN(ret, 175 176 "Failed to create OHCI RH function: %s.\n", str_error(ret)); 176 instance->rh_fun->ops = &rh_ops;177 ddf_fun_set_ops(instance->rh_fun, &rh_ops); 177 178 178 179 uintptr_t reg_base = 0; … … 183 184 CHECK_RET_DEST_FREE_RETURN(ret, 184 185 "Failed to get register memory addresses for %" PRIun ": %s.\n", 185 d evice->handle, str_error(ret));186 ddf_dev_get_handle(device), str_error(ret)); 186 187 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d.\n", 187 188 (void *) reg_base, reg_size, irq);
Note:
See TracChangeset
for help on using the changeset viewer.