Changeset 659ca07 in mainline for uspace/lib/drv/generic/driver.c
- Timestamp:
- 2011-02-14T22:22:54Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 34588a80
- Parents:
- cd0684d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/driver.c
rcd0684d r659ca07 632 632 } 633 633 634 635 /** Wrapper for child_device_register for devices with single match id.636 *637 * @param parent Parent device.638 * @param child_name Child device name.639 * @param child_match_id Child device match id.640 * @param child_match_score Child device match score.641 * @return Error code.642 */643 int register_function_wrapper(device_t *dev, const char *fun_name,644 const char *match_id, int match_score)645 {646 function_t *fun = NULL;647 match_id_t *m_id = NULL;648 int rc;649 650 fun = ddf_fun_create(dev, fun_inner, fun_name);651 if (fun == NULL) {652 rc = ENOMEM;653 goto failure;654 }655 656 m_id = create_match_id();657 if (m_id == NULL) {658 rc = ENOMEM;659 goto failure;660 }661 662 m_id->id = match_id;663 m_id->score = match_score;664 add_match_id(&fun->match_ids, m_id);665 666 rc = ddf_fun_bind(fun);667 if (rc != EOK)668 goto failure;669 670 return EOK;671 672 failure:673 if (m_id != NULL) {674 m_id->id = NULL;675 delete_match_id(m_id);676 }677 678 if (fun != NULL) {679 fun->name = NULL;680 delete_function(fun);681 }682 683 return rc;684 }685 686 634 /** Get default handler for client requests */ 687 635 remote_handler_t *function_get_default_handler(function_t *fun)
Note:
See TracChangeset
for help on using the changeset viewer.