Changeset 97a62fe in mainline for uspace/drv/test1/test1.c


Ignore:
Timestamp:
2011-02-14T21:41:50Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cd0684d
Parents:
7df0477e
Message:

Refactor create_function(), delete_function() and register_function() into
ddf_fun_create(), ddf_fun_destroy() and ddf_fun_bind(). This is not just
a rename.

File:
1 edited

Legend:

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

    r7df0477e r97a62fe  
    9292{
    9393        function_t *fun_a;
     94        int rc;
    9495
    9596        printf(NAME ": add_device(name=\"%s\", handle=%d)\n",
    9697            dev->name, (int) dev->handle);
    9798
    98         fun_a = create_function();
    99         fun_a->ftype = fun_exposed;
    100         fun_a->name = "a";
     99        fun_a = ddf_fun_create(dev, fun_exposed, "a");
     100        if (fun_a == NULL) {
     101                printf(NAME ": error creating function 'a'.\n");
     102                return ENOMEM;
     103        }
    101104
    102         register_function(fun_a, dev);
     105        rc = ddf_fun_bind(fun_a);
     106        if (rc != EOK) {
     107                printf(NAME ": error binding function 'a'.\n");
     108                return rc;
     109        }
    103110
    104111        add_function_to_class(fun_a, "virtual");
Note: See TracChangeset for help on using the changeset viewer.