Changeset a35b458 in mainline for uspace/drv/platform/msim/msim.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 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/msim/msim.c
r3061bc1 ra35b458 147 147 { 148 148 msim_fun_t *fun = msim_fun(fnode); 149 149 150 150 assert(fun != NULL); 151 151 return &fun->hw_resources; … … 184 184 { 185 185 ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name); 186 186 187 187 ddf_fun_t *fnode = NULL; 188 188 errno_t rc; 189 189 190 190 /* Create new device. */ 191 191 fnode = ddf_fun_create(dev, fun_inner, name); 192 192 if (fnode == NULL) 193 193 goto failure; 194 194 195 195 msim_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(msim_fun_t)); 196 196 if (fun == NULL) 197 197 goto failure; 198 198 199 199 *fun = *fun_proto; 200 200 201 201 /* Add match ID */ 202 202 rc = ddf_fun_add_match_id(fnode, str_match_id, 100); 203 203 if (rc != EOK) 204 204 goto failure; 205 205 206 206 /* Set provided operations to the device. */ 207 207 ddf_fun_set_ops(fnode, &msim_fun_ops); 208 208 209 209 /* Register function. */ 210 210 if (ddf_fun_bind(fnode) != EOK) { … … 212 212 goto failure; 213 213 } 214 214 215 215 return true; 216 216 217 217 failure: 218 218 if (fnode != NULL) 219 219 ddf_fun_destroy(fnode); 220 220 221 221 ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name); 222 222 223 223 return false; 224 224 } … … 246 246 if (!msim_add_functions(dev)) 247 247 ddf_msg(LVL_ERROR, "Failed to add functions for the MSIM platform."); 248 248 249 249 return EOK; 250 250 }
Note:
See TracChangeset
for help on using the changeset viewer.