Changes in uspace/drv/root/root.c [ebcb05a:af6b5157] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/root/root.c
rebcb05a 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)", 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, "Failed creating function %s", 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, "Failed adding match IDs to function %s", 106 name); 104 printf(NAME ": error adding match IDs to function %s\n", name); 107 105 ddf_fun_destroy(fun); 108 106 return rc; … … 111 109 rc = ddf_fun_bind(fun); 112 110 if (rc != EOK) { 113 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name,111 printf(NAME ": error binding function %s: %s\n", name, 114 112 str_error(rc)); 115 113 ddf_fun_destroy(fun); … … 138 136 platform = sysinfo_get_data("platform", &platform_size); 139 137 if (platform == NULL) { 140 ddf_msg(LVL_ERROR, "Failed to obtain platform name.");138 printf(NAME ": Failed to obtain platform name.\n"); 141 139 return ENOENT; 142 140 } … … 145 143 platform = realloc(platform, platform_size + 1); 146 144 if (platform == NULL) { 147 ddf_msg(LVL_ERROR, "Memory allocation failed.");145 printf(NAME ": Memory allocation failed.\n"); 148 146 return ENOMEM; 149 147 } … … 153 151 /* Construct match ID. */ 154 152 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"); 156 154 return ENOMEM; 157 155 } 158 156 159 157 /* 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); 163 161 164 162 fun = ddf_fun_create(dev, fun_inner, name); 165 163 if (fun == NULL) { 166 ddf_msg(LVL_ERROR, "Error creating function %s", name);164 printf(NAME ": error creating function %s\n", name); 167 165 return ENOMEM; 168 166 } … … 170 168 rc = ddf_fun_add_match_id(fun, match_id, PLATFORM_FUN_MATCH_SCORE); 171 169 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); 174 171 ddf_fun_destroy(fun); 175 172 return rc; … … 178 175 rc = ddf_fun_bind(fun); 179 176 if (rc != EOK) { 180 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name,177 printf(NAME ": error binding function %s: %s\n", name, 181 178 str_error(rc)); 182 179 ddf_fun_destroy(fun); … … 194 191 static int root_add_device(ddf_dev_t *dev) 195 192 { 196 ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun,193 printf(NAME ": root_add_device, device handle=%" PRIun "\n", 197 194 dev->handle); 198 195 … … 207 204 int res = add_platform_fun(dev); 208 205 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"); 210 207 211 208 return res; … … 215 212 { 216 213 printf(NAME ": HelenOS root device driver\n"); 217 218 ddf_log_init(NAME, LVL_ERROR);219 214 return ddf_driver_main(&root_driver); 220 215 }
Note:
See TracChangeset
for help on using the changeset viewer.