Changes in uspace/drv/test2/test2.c [af6b5157:fc51296] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/test2/test2.c
raf6b5157 rfc51296 36 36 #include <str_error.h> 37 37 #include <ddf/driver.h> 38 #include <ddf/log.h> 38 39 39 40 #define NAME "test2" … … 64 65 int rc; 65 66 66 printf(NAME ": registering function `%s': %s.\n", name, message);67 ddf_msg(LVL_DEBUG, "Registering function `%s': %s.\n", name, message); 67 68 68 69 fun = ddf_fun_create(parent, fun_inner, name); 69 70 if (fun == NULL) { 70 printf(NAME ": errorcreating function %s\n", name);71 ddf_msg(LVL_ERROR, "Failed creating function %s\n", name); 71 72 return ENOMEM; 72 73 } … … 74 75 rc = ddf_fun_add_match_id(fun, match_id, match_score); 75 76 if (rc != EOK) { 76 printf(NAME ": error adding match IDs to function %s\n", name); 77 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n", 78 name); 77 79 ddf_fun_destroy(fun); 78 80 return rc; … … 81 83 rc = ddf_fun_bind(fun); 82 84 if (rc != EOK) { 83 printf(NAME ": errorbinding function %s: %s\n", name,85 ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", name, 84 86 str_error(rc)); 85 87 ddf_fun_destroy(fun); … … 87 89 } 88 90 89 printf(NAME ": registered child device `%s'\n", name);91 ddf_msg(LVL_NOTE, "Registered child device `%s'\n", name); 90 92 return EOK; 91 93 } … … 111 113 fun_a = ddf_fun_create(dev, fun_exposed, "a"); 112 114 if (fun_a == NULL) { 113 printf(NAME ": errorcreating function 'a'.\n");115 ddf_msg(LVL_ERROR, "Failed creating function 'a'.\n"); 114 116 return ENOMEM; 115 117 } … … 117 119 rc = ddf_fun_bind(fun_a); 118 120 if (rc != EOK) { 119 printf(NAME ": errorbinding function 'a'.\n");121 ddf_msg(LVL_ERROR, "Failed binding function 'a'.\n"); 120 122 return rc; 121 123 } … … 128 130 static int test2_add_device(ddf_dev_t *dev) 129 131 { 130 printf(NAME ":test2_add_device(name=\"%s\", handle=%d)\n",132 ddf_msg(LVL_DEBUG, "test2_add_device(name=\"%s\", handle=%d)\n", 131 133 dev->name, (int) dev->handle); 132 134 … … 134 136 fid_t postpone = fibril_create(postponed_birth, dev); 135 137 if (postpone == 0) { 136 printf(NAME ": fibril_create() error\n");138 ddf_msg(LVL_ERROR, "fibril_create() failed.\n"); 137 139 return ENOMEM; 138 140 } … … 149 151 { 150 152 printf(NAME ": HelenOS test2 virtual device driver\n"); 153 ddf_log_init(NAME, LVL_ERROR); 151 154 return ddf_driver_main(&test2_driver); 152 155 }
Note:
See TracChangeset
for help on using the changeset viewer.