Changes in uspace/drv/test1/test1.c [fc51296:af6b5157] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/test1/test1.c
rfc51296 raf6b5157 35 35 #include <str_error.h> 36 36 #include <ddf/driver.h> 37 #include <ddf/log.h>38 37 39 38 #include "test1.h" … … 64 63 int rc; 65 64 66 ddf_msg(LVL_DEBUG, "Registering function `%s': %s.\n", name, message);65 printf(NAME ": registering function `%s': %s.\n", name, message); 67 66 68 67 fun = ddf_fun_create(parent, fun_inner, name); 69 68 if (fun == NULL) { 70 ddf_msg(LVL_ERROR, "Failedcreating function %s\n", name);69 printf(NAME ": error creating function %s\n", name); 71 70 return ENOMEM; 72 71 } … … 74 73 rc = ddf_fun_add_match_id(fun, match_id, match_score); 75 74 if (rc != EOK) { 76 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n", 77 name); 75 printf(NAME ": error adding match IDs to function %s\n", name); 78 76 ddf_fun_destroy(fun); 79 77 return rc; … … 82 80 rc = ddf_fun_bind(fun); 83 81 if (rc != EOK) { 84 ddf_msg(LVL_ERROR, "Failedbinding function %s: %s\n", name,82 printf(NAME ": error binding function %s: %s\n", name, 85 83 str_error(rc)); 86 84 ddf_fun_destroy(fun); … … 88 86 } 89 87 90 ddf_msg(LVL_NOTE, "Registered child device `%s'\n", name);88 printf(NAME ": registered child device `%s'\n", name); 91 89 return EOK; 92 90 } … … 114 112 int rc; 115 113 116 ddf_msg(LVL_DEBUG, "add_device(name=\"%s\", handle=%d)\n",114 printf(NAME ": add_device(name=\"%s\", handle=%d)\n", 117 115 dev->name, (int) dev->handle); 118 116 119 117 fun_a = ddf_fun_create(dev, fun_exposed, "a"); 120 118 if (fun_a == NULL) { 121 ddf_msg(LVL_ERROR, "Failedcreating function 'a'.\n");119 printf(NAME ": error creating function 'a'.\n"); 122 120 return ENOMEM; 123 121 } … … 125 123 rc = ddf_fun_bind(fun_a); 126 124 if (rc != EOK) { 127 ddf_msg(LVL_ERROR, "Failedbinding function 'a'.\n");125 printf(NAME ": error binding function 'a'.\n"); 128 126 return rc; 129 127 } … … 142 140 } 143 141 144 ddf_msg(LVL_DEBUG, "Device `%s' accepted.\n", dev->name);142 printf(NAME ": device `%s' accepted.\n", dev->name); 145 143 146 144 return EOK; … … 150 148 { 151 149 printf(NAME ": HelenOS test1 virtual device driver\n"); 152 ddf_log_init(NAME, LVL_ERROR);153 150 return ddf_driver_main(&test1_driver); 154 151 }
Note:
See TracChangeset
for help on using the changeset viewer.