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