Changeset b7fd2a0 in mainline for uspace/drv/test
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/drv/test
- Files:
-
- 3 edited
-
test1/test1.c (modified) (9 diffs)
-
test2/test2.c (modified) (10 diffs)
-
test3/test3.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/test/test1/test1.c
r36f0738 rb7fd2a0 40 40 #include "test1.h" 41 41 42 static int test1_dev_add(ddf_dev_t *dev);43 static int test1_dev_remove(ddf_dev_t *dev);44 static int test1_dev_gone(ddf_dev_t *dev);45 static int test1_fun_online(ddf_fun_t *fun);46 static int test1_fun_offline(ddf_fun_t *fun);42 static errno_t test1_dev_add(ddf_dev_t *dev); 43 static errno_t test1_dev_remove(ddf_dev_t *dev); 44 static errno_t test1_dev_gone(ddf_dev_t *dev); 45 static errno_t test1_fun_online(ddf_fun_t *fun); 46 static errno_t test1_fun_offline(ddf_fun_t *fun); 47 47 48 48 static driver_ops_t driver_ops = { … … 73 73 * @param score Device match score. 74 74 */ 75 static int register_fun_verbose(ddf_dev_t *parent, const char *message,75 static errno_t register_fun_verbose(ddf_dev_t *parent, const char *message, 76 76 const char *name, const char *match_id, int match_score, 77 int expected_rc, ddf_fun_t **pfun)77 errno_t expected_rc, ddf_fun_t **pfun) 78 78 { 79 79 ddf_fun_t *fun = NULL; 80 int rc;80 errno_t rc; 81 81 82 82 ddf_msg(LVL_DEBUG, "Registering function `%s': %s.", name, message); … … 141 141 * @return Error code reporting success of the operation. 142 142 */ 143 static int test1_dev_add(ddf_dev_t *dev)143 static errno_t test1_dev_add(ddf_dev_t *dev) 144 144 { 145 145 ddf_fun_t *fun_a; 146 146 test1_t *test1; 147 147 const char *dev_name; 148 int rc;148 errno_t rc; 149 149 150 150 dev_name = ddf_dev_get_name(dev); … … 196 196 } 197 197 198 static int fun_remove(ddf_fun_t *fun, const char *name)199 { 200 int rc;198 static errno_t fun_remove(ddf_fun_t *fun, const char *name) 199 { 200 errno_t rc; 201 201 202 202 ddf_msg(LVL_DEBUG, "fun_remove(%p, '%s')", fun, name); … … 217 217 } 218 218 219 static int fun_unbind(ddf_fun_t *fun, const char *name)220 { 221 int rc;219 static errno_t fun_unbind(ddf_fun_t *fun, const char *name) 220 { 221 errno_t rc; 222 222 223 223 ddf_msg(LVL_DEBUG, "fun_unbind(%p, '%s')", fun, name); … … 232 232 } 233 233 234 static int test1_dev_remove(ddf_dev_t *dev)234 static errno_t test1_dev_remove(ddf_dev_t *dev) 235 235 { 236 236 test1_t *test1 = (test1_t *)ddf_dev_data_get(dev); 237 int rc;237 errno_t rc; 238 238 239 239 ddf_msg(LVL_DEBUG, "test1_dev_remove(%p)", dev); … … 260 260 } 261 261 262 static int test1_dev_gone(ddf_dev_t *dev)262 static errno_t test1_dev_gone(ddf_dev_t *dev) 263 263 { 264 264 test1_t *test1 = (test1_t *)ddf_dev_data_get(dev); 265 int rc;265 errno_t rc; 266 266 267 267 ddf_msg(LVL_DEBUG, "test1_dev_remove(%p)", dev); … … 288 288 } 289 289 290 static int test1_fun_online(ddf_fun_t *fun)290 static errno_t test1_fun_online(ddf_fun_t *fun) 291 291 { 292 292 ddf_msg(LVL_DEBUG, "test1_fun_online()"); … … 294 294 } 295 295 296 static int test1_fun_offline(ddf_fun_t *fun)296 static errno_t test1_fun_offline(ddf_fun_t *fun) 297 297 { 298 298 ddf_msg(LVL_DEBUG, "test1_fun_offline()"); -
uspace/drv/test/test2/test2.c
r36f0738 rb7fd2a0 40 40 #define NAME "test2" 41 41 42 static int test2_dev_add(ddf_dev_t *dev);43 static int test2_dev_remove(ddf_dev_t *dev);44 static int test2_dev_gone(ddf_dev_t *dev);45 static int test2_fun_online(ddf_fun_t *fun);46 static int test2_fun_offline(ddf_fun_t *fun);42 static errno_t test2_dev_add(ddf_dev_t *dev); 43 static errno_t test2_dev_remove(ddf_dev_t *dev); 44 static errno_t test2_dev_gone(ddf_dev_t *dev); 45 static errno_t test2_fun_online(ddf_fun_t *fun); 46 static errno_t test2_fun_offline(ddf_fun_t *fun); 47 47 48 48 static driver_ops_t driver_ops = { … … 77 77 * @param score Device match score. 78 78 */ 79 static int register_fun_verbose(ddf_dev_t *parent, const char *message,79 static errno_t register_fun_verbose(ddf_dev_t *parent, const char *message, 80 80 const char *name, const char *match_id, int match_score, ddf_fun_t **pfun) 81 81 { 82 82 ddf_fun_t *fun; 83 int rc;83 errno_t rc; 84 84 85 85 ddf_msg(LVL_DEBUG, "Registering function `%s': %s.", name, message); … … 118 118 * @return Always EOK. 119 119 */ 120 static int plug_unplug(void *arg)120 static errno_t plug_unplug(void *arg) 121 121 { 122 122 test2_t *test2 = (test2_t *) arg; 123 123 ddf_fun_t *fun_a; 124 int rc;124 errno_t rc; 125 125 126 126 async_usleep(1000); … … 157 157 } 158 158 159 static int fun_remove(ddf_fun_t *fun, const char *name)160 { 161 int rc;159 static errno_t fun_remove(ddf_fun_t *fun, const char *name) 160 { 161 errno_t rc; 162 162 163 163 ddf_msg(LVL_DEBUG, "fun_remove(%p, '%s')", fun, name); … … 178 178 } 179 179 180 static int fun_unbind(ddf_fun_t *fun, const char *name)181 { 182 int rc;180 static errno_t fun_unbind(ddf_fun_t *fun, const char *name) 181 { 182 errno_t rc; 183 183 184 184 ddf_msg(LVL_DEBUG, "fun_unbind(%p, '%s')", fun, name); … … 193 193 } 194 194 195 static int test2_dev_add(ddf_dev_t *dev)195 static errno_t test2_dev_add(ddf_dev_t *dev) 196 196 { 197 197 test2_t *test2; … … 224 224 } 225 225 226 static int test2_dev_remove(ddf_dev_t *dev)226 static errno_t test2_dev_remove(ddf_dev_t *dev) 227 227 { 228 228 test2_t *test2 = (test2_t *)ddf_dev_data_get(dev); 229 int rc;229 errno_t rc; 230 230 231 231 ddf_msg(LVL_DEBUG, "test2_dev_remove(%p)", dev); … … 258 258 } 259 259 260 static int test2_dev_gone(ddf_dev_t *dev)260 static errno_t test2_dev_gone(ddf_dev_t *dev) 261 261 { 262 262 test2_t *test2 = (test2_t *)ddf_dev_data_get(dev); 263 int rc;263 errno_t rc; 264 264 265 265 ddf_msg(LVL_DEBUG, "test2_dev_gone(%p)", dev); … … 293 293 294 294 295 static int test2_fun_online(ddf_fun_t *fun)295 static errno_t test2_fun_online(ddf_fun_t *fun) 296 296 { 297 297 ddf_msg(LVL_DEBUG, "test2_fun_online()"); … … 299 299 } 300 300 301 static int test2_fun_offline(ddf_fun_t *fun)301 static errno_t test2_fun_offline(ddf_fun_t *fun) 302 302 { 303 303 ddf_msg(LVL_DEBUG, "test2_fun_offline()"); -
uspace/drv/test/test3/test3.c
r36f0738 rb7fd2a0 41 41 #define NUM_FUNCS 20 42 42 43 static int test3_dev_add(ddf_dev_t *dev);44 static int test3_dev_remove(ddf_dev_t *dev);45 static int test3_fun_online(ddf_fun_t *fun);46 static int test3_fun_offline(ddf_fun_t *fun);43 static errno_t test3_dev_add(ddf_dev_t *dev); 44 static errno_t test3_dev_remove(ddf_dev_t *dev); 45 static errno_t test3_fun_online(ddf_fun_t *fun); 46 static errno_t test3_fun_offline(ddf_fun_t *fun); 47 47 48 48 static driver_ops_t driver_ops = { … … 63 63 } test3_t; 64 64 65 static int register_fun_and_add_to_category(ddf_dev_t *parent,65 static errno_t register_fun_and_add_to_category(ddf_dev_t *parent, 66 66 const char *base_name, size_t index, const char *class_name, 67 67 ddf_fun_t **pfun) 68 68 { 69 69 ddf_fun_t *fun = NULL; 70 int rc;70 errno_t rc; 71 71 char *fun_name = NULL; 72 72 … … 106 106 } 107 107 108 static int fun_remove(ddf_fun_t *fun, const char *name)108 static errno_t fun_remove(ddf_fun_t *fun, const char *name) 109 109 { 110 int rc;110 errno_t rc; 111 111 112 112 ddf_msg(LVL_DEBUG, "fun_remove(%p, '%s')", fun, name); … … 127 127 } 128 128 129 static int test3_dev_add(ddf_dev_t *dev)129 static errno_t test3_dev_add(ddf_dev_t *dev) 130 130 { 131 int rc = EOK;131 errno_t rc = EOK; 132 132 test3_t *test3; 133 133 … … 153 153 } 154 154 155 static int test3_dev_remove(ddf_dev_t *dev)155 static errno_t test3_dev_remove(ddf_dev_t *dev) 156 156 { 157 157 test3_t *test3 = (test3_t *)ddf_dev_data_get(dev); 158 158 char *fun_name; 159 int rc;159 errno_t rc; 160 160 size_t i; 161 161 … … 176 176 } 177 177 178 static int test3_fun_online(ddf_fun_t *fun)178 static errno_t test3_fun_online(ddf_fun_t *fun) 179 179 { 180 180 ddf_msg(LVL_DEBUG, "test3_fun_online()"); … … 182 182 } 183 183 184 static int test3_fun_offline(ddf_fun_t *fun)184 static errno_t test3_fun_offline(ddf_fun_t *fun) 185 185 { 186 186 ddf_msg(LVL_DEBUG, "test3_fun_offline()");
Note:
See TracChangeset
for help on using the changeset viewer.
