Ignore:
File:
1 edited

Legend:

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

    rebcb05a raf6b5157  
    3636#include <str_error.h>
    3737#include <ddf/driver.h>
    38 #include <ddf/log.h>
    3938
    4039#define NAME "test2"
     
    6564        int rc;
    6665
    67         ddf_msg(LVL_DEBUG, "Registering function `%s': %s.", name, message);
     66        printf(NAME ": registering function `%s': %s.\n", name, message);
    6867
    6968        fun = ddf_fun_create(parent, fun_inner, name);
    7069        if (fun == NULL) {
    71                 ddf_msg(LVL_ERROR, "Failed creating function %s", name);
     70                printf(NAME ": error creating function %s\n", name);
    7271                return ENOMEM;
    7372        }
     
    7574        rc = ddf_fun_add_match_id(fun, match_id, match_score);
    7675        if (rc != EOK) {
    77                 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s",
    78                     name);
     76                printf(NAME ": error adding match IDs to function %s\n", name);
    7977                ddf_fun_destroy(fun);
    8078                return rc;
     
    8381        rc = ddf_fun_bind(fun);
    8482        if (rc != EOK) {
    85                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name,
     83                printf(NAME ": error binding function %s: %s\n", name,
    8684                    str_error(rc));
    8785                ddf_fun_destroy(fun);
     
    8987        }
    9088
    91         ddf_msg(LVL_NOTE, "Registered child device `%s'", name);
     89        printf(NAME ": registered child device `%s'\n", name);
    9290        return EOK;
    9391}
     
    113111        fun_a = ddf_fun_create(dev, fun_exposed, "a");
    114112        if (fun_a == NULL) {
    115                 ddf_msg(LVL_ERROR, "Failed creating function 'a'.");
     113                printf(NAME ": error creating function 'a'.\n");
    116114                return ENOMEM;
    117115        }
     
    119117        rc = ddf_fun_bind(fun_a);
    120118        if (rc != EOK) {
    121                 ddf_msg(LVL_ERROR, "Failed binding function 'a'.");
     119                printf(NAME ": error binding function 'a'.\n");
    122120                return rc;
    123121        }
     
    130128static int test2_add_device(ddf_dev_t *dev)
    131129{
    132         ddf_msg(LVL_DEBUG, "test2_add_device(name=\"%s\", handle=%d)",
     130        printf(NAME ": test2_add_device(name=\"%s\", handle=%d)\n",
    133131            dev->name, (int) dev->handle);
    134132
     
    136134                fid_t postpone = fibril_create(postponed_birth, dev);
    137135                if (postpone == 0) {
    138                         ddf_msg(LVL_ERROR, "fibril_create() failed.");
     136                        printf(NAME ": fibril_create() error\n");
    139137                        return ENOMEM;
    140138                }
     
    151149{
    152150        printf(NAME ": HelenOS test2 virtual device driver\n");
    153         ddf_log_init(NAME, LVL_ERROR);
    154151        return ddf_driver_main(&test2_driver);
    155152}
Note: See TracChangeset for help on using the changeset viewer.