Changeset 80a96d2 in mainline for uspace/drv/test/test1/test1.c
- Timestamp:
- 2011-09-05T21:26:47Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b33870b
- Parents:
- 16cc9a6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/test/test1/test1.c
r16cc9a6 r80a96d2 42 42 static int test1_add_device(ddf_dev_t *dev); 43 43 static int test1_dev_remove(ddf_dev_t *dev); 44 static int test1_dev_gone(ddf_dev_t *dev); 44 45 static int test1_fun_online(ddf_fun_t *fun); 45 46 static int test1_fun_offline(ddf_fun_t *fun); … … 48 49 .add_device = &test1_add_device, 49 50 .dev_remove = &test1_dev_remove, 51 .dev_gone = &test1_dev_gone, 50 52 .fun_online = &test1_fun_online, 51 53 .fun_offline = &test1_fun_offline … … 213 215 } 214 216 217 static int fun_unbind(ddf_fun_t *fun, const char *name) 218 { 219 int rc; 220 221 ddf_msg(LVL_DEBUG, "fun_unbind(%p, '%s')", fun, name); 222 rc = ddf_fun_unbind(fun); 223 if (rc != EOK) { 224 ddf_msg(LVL_ERROR, "Failed unbinding function '%s'.", name); 225 return rc; 226 } 227 228 ddf_fun_destroy(fun); 229 return EOK; 230 } 231 215 232 static int test1_dev_remove(ddf_dev_t *dev) 216 233 { … … 234 251 if (test1->child != NULL) { 235 252 rc = fun_remove(test1->child, "child"); 253 if (rc != EOK) 254 return rc; 255 } 256 257 return EOK; 258 } 259 260 static int test1_dev_gone(ddf_dev_t *dev) 261 { 262 test1_t *test1 = (test1_t *)dev->driver_data; 263 int rc; 264 265 ddf_msg(LVL_DEBUG, "test1_dev_remove(%p)", dev); 266 267 if (test1->fun_a != NULL) { 268 rc = fun_unbind(test1->fun_a, "a"); 269 if (rc != EOK) 270 return rc; 271 } 272 273 if (test1->clone != NULL) { 274 rc = fun_unbind(test1->clone, "clone"); 275 if (rc != EOK) 276 return rc; 277 } 278 279 if (test1->child != NULL) { 280 rc = fun_unbind(test1->child, "child"); 236 281 if (rc != EOK) 237 282 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.