Changes in uspace/drv/root/root.c [fc51296:af6b5157] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/root/root.c
rfc51296 raf6b5157 52 52 53 53 #include <ddf/driver.h> 54 #include <ddf/log.h>55 54 #include <devman.h> 56 55 #include <ipc/devman.h> … … 90 89 int rc; 91 90 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, 94 93 VIRTUAL_FUN_MATCH_SCORE, VIRTUAL_FUN_MATCH_ID); 95 94 96 95 fun = ddf_fun_create(dev, fun_inner, name); 97 96 if (fun == NULL) { 98 ddf_msg(LVL_ERROR, "Failedcreating function %s\n", name);97 printf(NAME ": error creating function %s\n", name); 99 98 return ENOMEM; 100 99 } … … 103 102 VIRTUAL_FUN_MATCH_SCORE); 104 103 if (rc != EOK) { 105 ddf_msg(LVL_ERROR, "Failedadding match IDs to function %s\n", name);104 printf(NAME ": error adding match IDs to function %s\n", name); 106 105 ddf_fun_destroy(fun); 107 106 return rc; … … 110 109 rc = ddf_fun_bind(fun); 111 110 if (rc != EOK) { 112 ddf_msg(LVL_ERROR, "Failedbinding function %s: %s\n", name,111 printf(NAME ": error binding function %s: %s\n", name, 113 112 str_error(rc)); 114 113 ddf_fun_destroy(fun); … … 137 136 platform = sysinfo_get_data("platform", &platform_size); 138 137 if (platform == NULL) { 139 ddf_msg(LVL_ERROR, "Failed to obtain platform name.\n");138 printf(NAME ": Failed to obtain platform name.\n"); 140 139 return ENOENT; 141 140 } … … 144 143 platform = realloc(platform, platform_size + 1); 145 144 if (platform == NULL) { 146 ddf_msg(LVL_ERROR, "Memory allocation failed.\n");145 printf(NAME ": Memory allocation failed.\n"); 147 146 return ENOMEM; 148 147 } … … 152 151 /* Construct match ID. */ 153 152 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"); 155 154 return ENOMEM; 156 155 } 157 156 158 157 /* 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); 162 161 163 162 fun = ddf_fun_create(dev, fun_inner, name); 164 163 if (fun == NULL) { 165 ddf_msg(LVL_ERROR, "Error creating function %s\n", name);164 printf(NAME ": error creating function %s\n", name); 166 165 return ENOMEM; 167 166 } … … 169 168 rc = ddf_fun_add_match_id(fun, match_id, PLATFORM_FUN_MATCH_SCORE); 170 169 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); 173 171 ddf_fun_destroy(fun); 174 172 return rc; … … 177 175 rc = ddf_fun_bind(fun); 178 176 if (rc != EOK) { 179 ddf_msg(LVL_ERROR, "Failedbinding function %s: %s\n", name,177 printf(NAME ": error binding function %s: %s\n", name, 180 178 str_error(rc)); 181 179 ddf_fun_destroy(fun); … … 193 191 static int root_add_device(ddf_dev_t *dev) 194 192 { 195 ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun "\n",193 printf(NAME ": root_add_device, device handle=%" PRIun "\n", 196 194 dev->handle); 197 195 … … 206 204 int res = add_platform_fun(dev); 207 205 if (EOK != res) 208 ddf_msg(LVL_ERROR, "Failed addingchild device for platform.\n");206 printf(NAME ": failed to add child device for platform.\n"); 209 207 210 208 return res; … … 214 212 { 215 213 printf(NAME ": HelenOS root device driver\n"); 216 217 ddf_log_init(NAME, LVL_ERROR);218 214 return ddf_driver_main(&root_driver); 219 215 }
Note:
See TracChangeset
for help on using the changeset viewer.