Changeset 97a62fe in mainline for uspace/drv/test2/test2.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/test2/test2.c

    r7df0477e r97a62fe  
    8282{
    8383        device_t *dev = (device_t *) arg;
    84         function_t *fun;
     84        function_t *fun_a;
     85        int rc;
    8586
    8687        async_usleep(1000);
     
    9192            "test1", "virtual&test1", 10);
    9293
    93         fun = create_function();
    94         fun->ftype = fun_exposed;
    95         fun->name = "a";
     94        fun_a = ddf_fun_create(dev, fun_exposed, "a");
     95        if (fun_a == NULL) {
     96                printf(NAME ": error creating function 'a'.\n");
     97                return ENOMEM;
     98        }
    9699
    97         register_function(fun, dev);
     100        rc = ddf_fun_bind(fun_a);
     101        if (rc != EOK) {
     102                printf(NAME ": error binding function 'a'.\n");
     103                return rc;
     104        }
    98105
    99         add_function_to_class(fun, "virtual");
     106        add_function_to_class(fun_a, "virtual");
    100107
    101108        return EOK;
Note: See TracChangeset for help on using the changeset viewer.