Changes in uspace/drv/test/test3/test3.c [b7fd2a0:267f235] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/test/test3/test3.c
rb7fd2a0 r267f235 41 41 #define NUM_FUNCS 20 42 42 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);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); 47 47 48 48 static driver_ops_t driver_ops = { … … 63 63 } test3_t; 64 64 65 static errno_t register_fun_and_add_to_category(ddf_dev_t *parent,65 static int 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 errno_t rc;70 int rc; 71 71 char *fun_name = NULL; 72 72 73 if (asprintf(&fun_name, "%s%zu", base_name, index) < 0) {74 ddf_msg(LVL_ERROR, "Failed to format string: No memory");75 rc = ENOMEM;73 rc = asprintf(&fun_name, "%s%zu", base_name, index); 74 if (rc < 0) { 75 ddf_msg(LVL_ERROR, "Failed to format string: %s", str_error(rc)); 76 76 goto leave; 77 77 } … … 106 106 } 107 107 108 static errno_t fun_remove(ddf_fun_t *fun, const char *name)108 static int fun_remove(ddf_fun_t *fun, const char *name) 109 109 { 110 errno_t rc;110 int rc; 111 111 112 112 ddf_msg(LVL_DEBUG, "fun_remove(%p, '%s')", fun, name); … … 127 127 } 128 128 129 static errno_t test3_dev_add(ddf_dev_t *dev)129 static int test3_dev_add(ddf_dev_t *dev) 130 130 { 131 errno_t rc = EOK;131 int rc = EOK; 132 132 test3_t *test3; 133 133 … … 153 153 } 154 154 155 static errno_t test3_dev_remove(ddf_dev_t *dev)155 static int 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 errno_t rc;159 int rc; 160 160 size_t i; 161 161 162 162 for (i = 0; i < NUM_FUNCS; i++) { 163 if (asprintf(&fun_name, "test3_%zu", i) < 0) { 164 ddf_msg(LVL_ERROR, "Failed to format string: No memory"); 163 rc = asprintf(&fun_name, "test3_%zu", i); 164 if (rc < 0) { 165 ddf_msg(LVL_ERROR, "Failed to format string: %s", str_error(rc)); 165 166 return ENOMEM; 166 167 } … … 176 177 } 177 178 178 static errno_t test3_fun_online(ddf_fun_t *fun)179 static int test3_fun_online(ddf_fun_t *fun) 179 180 { 180 181 ddf_msg(LVL_DEBUG, "test3_fun_online()"); … … 182 183 } 183 184 184 static errno_t test3_fun_offline(ddf_fun_t *fun)185 static int test3_fun_offline(ddf_fun_t *fun) 185 186 { 186 187 ddf_msg(LVL_DEBUG, "test3_fun_offline()");
Note:
See TracChangeset
for help on using the changeset viewer.