Changeset a35b458 in mainline for uspace/drv/platform/pc/pc.c
- Timestamp:
- 2018-03-02T20:10:49Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/platform/pc/pc.c
r3061bc1 ra35b458 120 120 { 121 121 pc_fun_t *fun = pc_fun(fnode); 122 122 123 123 assert(fun != NULL); 124 124 return &fun->hw_resources; … … 128 128 { 129 129 /* TODO */ 130 130 131 131 return false; 132 132 } … … 135 135 { 136 136 pc_fun_t *fun = pc_fun(fnode); 137 137 138 138 assert(fun != NULL); 139 139 return &fun->pio_window; … … 157 157 { 158 158 ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name); 159 159 160 160 ddf_fun_t *fnode = NULL; 161 161 errno_t rc; 162 162 163 163 /* Create new device. */ 164 164 fnode = ddf_fun_create(dev, fun_inner, name); 165 165 if (fnode == NULL) 166 166 goto failure; 167 167 168 168 pc_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(pc_fun_t)); 169 169 *fun = *fun_proto; 170 170 171 171 /* Add match ID */ 172 172 rc = ddf_fun_add_match_id(fnode, str_match_id, 100); 173 173 if (rc != EOK) 174 174 goto failure; 175 175 176 176 /* Set provided operations to the device. */ 177 177 ddf_fun_set_ops(fnode, &pc_fun_ops); 178 178 179 179 /* Register function. */ 180 180 if (ddf_fun_bind(fnode) != EOK) { … … 182 182 goto failure; 183 183 } 184 184 185 185 return true; 186 186 187 187 failure: 188 188 if (fnode != NULL) 189 189 ddf_fun_destroy(fnode); 190 190 191 191 ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name); 192 192 193 193 return false; 194 194 } … … 209 209 ddf_msg(LVL_DEBUG, "pc_dev_add, device handle = %d", 210 210 (int)ddf_dev_get_handle(dev)); 211 211 212 212 /* Register functions. */ 213 213 if (!pc_add_functions(dev)) { 214 214 ddf_msg(LVL_ERROR, "Failed to add functions for PC platform."); 215 215 } 216 216 217 217 return EOK; 218 218 }
Note:
See TracChangeset
for help on using the changeset viewer.