Changeset cd0684d in mainline for uspace/drv/rootvirt/rootvirt.c


Ignore:
Timestamp:
2011-02-14T22:14:52Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
659ca07
Parents:
97a62fe
Message:

Remove register_function_wrapper() since it became practically useless.
Provide ddf_fun_add_match_id() instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/rootvirt/rootvirt.c

    r97a62fe rcd0684d  
    8080static int rootvirt_add_fun(device_t *vdev, virtual_function_t *vfun)
    8181{
     82        function_t *fun;
     83        int rc;
     84
    8285        printf(NAME ": registering function `%s' (match \"%s\")\n",
    8386            vfun->name, vfun->match_id);
    8487
    85         int rc = register_function_wrapper(vdev, vfun->name,
    86             vfun->match_id, 10);
    87 
    88         if (rc == EOK) {
    89                 printf(NAME ": registered child device `%s'\n",
    90                     vfun->name);
    91         } else {
    92                 printf(NAME ": failed to register child device `%s': %s\n",
    93                     vfun->name, str_error(rc));
     88        fun = ddf_fun_create(vdev, fun_inner, vfun->name);
     89        if (fun == NULL) {
     90                printf(NAME ": error creating function %s\n", vfun->name);
     91                return ENOMEM;
    9492        }
    9593
    96         return rc;
     94        rc = ddf_fun_add_match_id(fun, vfun->match_id, 10);
     95        if (rc != EOK) {
     96                printf(NAME ": error adding match IDs to function %s\n",
     97                    vfun->name);
     98                ddf_fun_destroy(fun);
     99                return rc;
     100        }
     101
     102        rc = ddf_fun_bind(fun);
     103        if (rc != EOK) {
     104                printf(NAME ": error binding function %s: %s\n", vfun->name,
     105                    str_error(rc));
     106                ddf_fun_destroy(fun);
     107                return rc;
     108        }
     109
     110        printf(NAME ": registered child device `%s'\n", vfun->name);
     111        return EOK;
    97112}
    98113
Note: See TracChangeset for help on using the changeset viewer.