Ignore:
File:
1 edited

Legend:

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

    rfc51296 raf6b5157  
    5252
    5353#include <ddf/driver.h>
    54 #include <ddf/log.h>
    5554#include <devman.h>
    5655#include <ipc/devman.h>
     
    9089        int rc;
    9190
    92         ddf_msg(LVL_DEBUG, "Adding new function for virtual devices. "
    93             "Function node is `%s' (%d %s)\n", name,
     91        printf(NAME ": adding new function for virtual devices.\n");
     92        printf(NAME ":   function node is `%s' (%d %s)\n", name,
    9493            VIRTUAL_FUN_MATCH_SCORE, VIRTUAL_FUN_MATCH_ID);
    9594
    9695        fun = ddf_fun_create(dev, fun_inner, name);
    9796        if (fun == NULL) {
    98                 ddf_msg(LVL_ERROR, "Failed creating function %s\n", name);
     97                printf(NAME ": error creating function %s\n", name);
    9998                return ENOMEM;
    10099        }
     
    103102            VIRTUAL_FUN_MATCH_SCORE);
    104103        if (rc != EOK) {
    105                 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n", name);
     104                printf(NAME ": error adding match IDs to function %s\n", name);
    106105                ddf_fun_destroy(fun);
    107106                return rc;
     
    110109        rc = ddf_fun_bind(fun);
    111110        if (rc != EOK) {
    112                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", name,
     111                printf(NAME ": error binding function %s: %s\n", name,
    113112                    str_error(rc));
    114113                ddf_fun_destroy(fun);
     
    137136        platform = sysinfo_get_data("platform", &platform_size);
    138137        if (platform == NULL) {
    139                 ddf_msg(LVL_ERROR, "Failed to obtain platform name.\n");
     138                printf(NAME ": Failed to obtain platform name.\n");
    140139                return ENOENT;
    141140        }
     
    144143        platform = realloc(platform, platform_size + 1);
    145144        if (platform == NULL) {
    146                 ddf_msg(LVL_ERROR, "Memory allocation failed.\n");
     145                printf(NAME ": Memory allocation failed.\n");
    147146                return ENOMEM;
    148147        }
     
    152151        /* Construct match ID. */
    153152        if (asprintf(&match_id, PLATFORM_FUN_MATCH_ID_FMT, platform) == -1) {
    154                 ddf_msg(LVL_ERROR, "Memory allocation failed.\n");
     153                printf(NAME ": Memory allocation failed.\n");
    155154                return ENOMEM;
    156155        }
    157156
    158157        /* Add function. */
    159         ddf_msg(LVL_DEBUG, "Adding platform function. Function node is `%s' "
    160             " (%d %s)\n", PLATFORM_FUN_NAME, PLATFORM_FUN_MATCH_SCORE,
    161             match_id);
     158        printf(NAME ": adding platform function\n");
     159        printf(NAME ":   function node is `%s' (%d %s)\n", PLATFORM_FUN_NAME,
     160            PLATFORM_FUN_MATCH_SCORE, match_id);
    162161
    163162        fun = ddf_fun_create(dev, fun_inner, name);
    164163        if (fun == NULL) {
    165                 ddf_msg(LVL_ERROR, "Error creating function %s\n", name);
     164                printf(NAME ": error creating function %s\n", name);
    166165                return ENOMEM;
    167166        }
     
    169168        rc = ddf_fun_add_match_id(fun, match_id, PLATFORM_FUN_MATCH_SCORE);
    170169        if (rc != EOK) {
    171                 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n",
    172                     name);
     170                printf(NAME ": error adding match IDs to function %s\n", name);
    173171                ddf_fun_destroy(fun);
    174172                return rc;
     
    177175        rc = ddf_fun_bind(fun);
    178176        if (rc != EOK) {
    179                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", name,
     177                printf(NAME ": error binding function %s: %s\n", name,
    180178                    str_error(rc));
    181179                ddf_fun_destroy(fun);
     
    193191static int root_add_device(ddf_dev_t *dev)
    194192{
    195         ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun "\n",
     193        printf(NAME ": root_add_device, device handle=%" PRIun "\n",
    196194            dev->handle);
    197195
     
    206204        int res = add_platform_fun(dev);
    207205        if (EOK != res)
    208                 ddf_msg(LVL_ERROR, "Failed adding child device for platform.\n");
     206                printf(NAME ": failed to add child device for platform.\n");
    209207
    210208        return res;
     
    214212{
    215213        printf(NAME ": HelenOS root device driver\n");
    216 
    217         ddf_log_init(NAME, LVL_ERROR);
    218214        return ddf_driver_main(&root_driver);
    219215}
Note: See TracChangeset for help on using the changeset viewer.