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