Changeset bebf97d in mainline
- Timestamp:
- 2012-11-21T22:59:09Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c739102
- Parents:
- 878b764
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c
r878b764 rbebf97d 35 35 /** @file 36 36 */ 37 #define _DDF_DATA_IMPLANT38 37 39 38 #define DEBUG_CM 0 … … 52 51 } rootamdm37x_fun_t; 53 52 53 /* See amdm37x TRM page. 3316 for these values */ 54 54 #define OHCI_BASE_ADDRESS 0x48064400 55 55 #define OHCI_SIZE 1024 … … 60 60 { 61 61 .type = MEM_RANGE, 62 /* See amdm37x TRM page. 3316 for these values */63 62 .res.io_range = { 64 63 .address = OHCI_BASE_ADDRESS, … … 71 70 .res.interrupt = { .irq = 76 }, 72 71 }, 73 };74 75 static const rootamdm37x_fun_t ohci = {76 .hw_resources = {77 .resources = ohci_res,78 .count = sizeof(ohci_res)/sizeof(ohci_res[0]),79 }80 72 }; 81 73 … … 96 88 }; 97 89 90 static const rootamdm37x_fun_t ohci = { 91 .hw_resources = { 92 .resources = ohci_res, 93 .count = sizeof(ohci_res)/sizeof(ohci_res[0]), 94 } 95 }; 96 98 97 static const rootamdm37x_fun_t ehci = { 99 98 .hw_resources = { … … 111 110 }; 112 111 113 static ddf_dev_ops_t rootamdm37x_fun_ops = 114 { 112 static ddf_dev_ops_t rootamdm37x_fun_ops = { 115 113 .interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops 116 114 }; … … 126 124 return ENOMEM; 127 125 128 129 126 /* Add match id */ 130 127 int ret = ddf_fun_add_match_id(fnode, str_match_id, 100); … … 134 131 } 135 132 133 /* Alloc needed data */ 134 rootamdm37x_fun_t *rf = 135 ddf_fun_data_alloc(fnode, sizeof(rootamdm37x_fun_t)); 136 if (!rf) { 137 ddf_fun_destroy(fnode); 138 return ENOMEM; 139 } 140 *rf = *fun; 141 136 142 /* Set provided operations to the device. */ 137 ddf_fun_data_implant(fnode, (void*)fun);138 143 ddf_fun_set_ops(fnode, &rootamdm37x_fun_ops); 139 144 … … 142 147 if (ret != EOK) { 143 148 ddf_msg(LVL_ERROR, "Failed binding function %s.", name); 144 // TODO This will try to free our data!145 149 ddf_fun_destroy(fnode); 146 150 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.