Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/main.c

    rd0dd7b5 r1dc4a5e  
    278278                return;
    279279        }
    280        
     280
    281281        fun_node_t *fun = create_fun_node();
    282         fun->ftype = ftype;
    283        
    284282        if (!insert_fun_node(&device_tree, fun, fun_name, pdev)) {
    285283                fibril_rwlock_write_unlock(&tree->rwlock);
     
    369367}
    370368
    371 /** Remove function. */
    372 static void devman_remove_function(ipc_callid_t callid, ipc_call_t *call)
    373 {
    374         devman_handle_t fun_handle = IPC_GET_ARG1(*call);
    375         dev_tree_t *tree = &device_tree;
    376         int rc;
    377        
    378         fibril_rwlock_write_lock(&tree->rwlock);
    379        
    380         fun_node_t *fun = find_fun_node_no_lock(&device_tree, fun_handle);
    381         if (fun == NULL) {
    382                 fibril_rwlock_write_unlock(&tree->rwlock);
    383                 async_answer_0(callid, ENOENT);
    384                 return;
    385         }
    386        
    387         log_msg(LVL_DEBUG, "devman_remove_function(fun='%s')", fun->pathname);
    388        
    389         if (fun->ftype == fun_inner) {
    390                 /* Handle possible descendants */
    391                 /* TODO */
    392                 log_msg(LVL_WARN, "devman_remove_function(): not handling "
    393                     "descendants\n");
    394         } else {
    395                 /* Unregister from location service */
    396                 rc = loc_service_unregister(fun->service_id);
    397                 if (rc != EOK) {
    398                         log_msg(LVL_ERROR, "Failed unregistering tree service.");
    399                         fibril_rwlock_write_unlock(&tree->rwlock);
    400                         async_answer_0(callid, EIO);
    401                         return;
    402                 }
    403         }
    404        
    405         remove_fun_node(&device_tree, fun);
    406         fibril_rwlock_write_unlock(&tree->rwlock);
    407         delete_fun_node(fun);
    408        
    409         log_msg(LVL_DEBUG, "devman_remove_function() succeeded.");
    410         async_answer_0(callid, EOK);
    411 }
    412 
    413369/** Initialize driver which has registered itself as running and ready.
    414370 *
     
    462418                case DEVMAN_ADD_DEVICE_TO_CATEGORY:
    463419                        devman_add_function_to_cat(callid, &call);
    464                         break;
    465                 case DEVMAN_REMOVE_FUNCTION:
    466                         devman_remove_function(callid, &call);
    467420                        break;
    468421                default:
Note: See TracChangeset for help on using the changeset viewer.