Ignore:
File:
1 edited

Legend:

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

    rebcb05a 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)", 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", 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",
    106                     name);
     104                printf(NAME ": error adding match IDs to function %s\n", name);
    107105                ddf_fun_destroy(fun);
    108106                return rc;
     
    111109        rc = ddf_fun_bind(fun);
    112110        if (rc != EOK) {
    113                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name,
     111                printf(NAME ": error binding function %s: %s\n", name,
    114112                    str_error(rc));
    115113                ddf_fun_destroy(fun);
     
    138136        platform = sysinfo_get_data("platform", &platform_size);
    139137        if (platform == NULL) {
    140                 ddf_msg(LVL_ERROR, "Failed to obtain platform name.");
     138                printf(NAME ": Failed to obtain platform name.\n");
    141139                return ENOENT;
    142140        }
     
    145143        platform = realloc(platform, platform_size + 1);
    146144        if (platform == NULL) {
    147                 ddf_msg(LVL_ERROR, "Memory allocation failed.");
     145                printf(NAME ": Memory allocation failed.\n");
    148146                return ENOMEM;
    149147        }
     
    153151        /* Construct match ID. */
    154152        if (asprintf(&match_id, PLATFORM_FUN_MATCH_ID_FMT, platform) == -1) {
    155                 ddf_msg(LVL_ERROR, "Memory allocation failed.");
     153                printf(NAME ": Memory allocation failed.\n");
    156154                return ENOMEM;
    157155        }
    158156
    159157        /* Add function. */
    160         ddf_msg(LVL_DEBUG, "Adding platform function. Function node is `%s' "
    161             " (%d %s)", PLATFORM_FUN_NAME, PLATFORM_FUN_MATCH_SCORE,
    162             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);
    163161
    164162        fun = ddf_fun_create(dev, fun_inner, name);
    165163        if (fun == NULL) {
    166                 ddf_msg(LVL_ERROR, "Error creating function %s", name);
     164                printf(NAME ": error creating function %s\n", name);
    167165                return ENOMEM;
    168166        }
     
    170168        rc = ddf_fun_add_match_id(fun, match_id, PLATFORM_FUN_MATCH_SCORE);
    171169        if (rc != EOK) {
    172                 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s",
    173                     name);
     170                printf(NAME ": error adding match IDs to function %s\n", name);
    174171                ddf_fun_destroy(fun);
    175172                return rc;
     
    178175        rc = ddf_fun_bind(fun);
    179176        if (rc != EOK) {
    180                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name,
     177                printf(NAME ": error binding function %s: %s\n", name,
    181178                    str_error(rc));
    182179                ddf_fun_destroy(fun);
     
    194191static int root_add_device(ddf_dev_t *dev)
    195192{
    196         ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun,
     193        printf(NAME ": root_add_device, device handle=%" PRIun "\n",
    197194            dev->handle);
    198195
     
    207204        int res = add_platform_fun(dev);
    208205        if (EOK != res)
    209                 ddf_msg(LVL_ERROR, "Failed adding child device for platform.");
     206                printf(NAME ": failed to add child device for platform.\n");
    210207
    211208        return res;
     
    215212{
    216213        printf(NAME ": HelenOS root device driver\n");
    217 
    218         ddf_log_init(NAME, LVL_ERROR);
    219214        return ddf_driver_main(&root_driver);
    220215}
Note: See TracChangeset for help on using the changeset viewer.