Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/test/test1/test1.c

    r80a96d2 rdeac215e  
    4242static int test1_add_device(ddf_dev_t *dev);
    4343static int test1_dev_remove(ddf_dev_t *dev);
    44 static int test1_dev_gone(ddf_dev_t *dev);
    4544static int test1_fun_online(ddf_fun_t *fun);
    4645static int test1_fun_offline(ddf_fun_t *fun);
     
    4948        .add_device = &test1_add_device,
    5049        .dev_remove = &test1_dev_remove,
    51         .dev_gone = &test1_dev_gone,
    5250        .fun_online = &test1_fun_online,
    5351        .fun_offline = &test1_fun_offline
     
    215213}
    216214
    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 
    232215static int test1_dev_remove(ddf_dev_t *dev)
    233216{
     
    258241}
    259242
    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");
    281                 if (rc != EOK)
    282                         return rc;
    283         }
    284 
    285         return EOK;
    286 }
    287 
    288243static int test1_fun_online(ddf_fun_t *fun)
    289244{
Note: See TracChangeset for help on using the changeset viewer.