Ignore:
File:
1 edited

Legend:

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

    r832cbe7 rfafb8e5  
    11/*
    2  * Copyright (c) 2025 Jiri Svoboda
    32 * Copyright (c) 2010 Lenka Trochtova
    43 * All rights reserved.
     
    361360        rc = loc_category_get_id(cat_name, &cat_id, IPC_FLAG_BLOCKING);
    362361        if (rc == EOK)
    363                 rc = loc_service_add_to_cat(devman_srv, fun->service_id, cat_id);
     362                rc = loc_service_add_to_cat(fun->service_id, cat_id);
    364363        if (rc == EOK) {
    365364                log_msg(LOG_DEFAULT, LVL_NOTE, "Function `%s' added to category `%s'.",
     
    453452        fun_busy_unlock(fun);
    454453        fun_del_ref(fun);
    455         async_answer_0(icall, EOK);
    456 }
    457 
    458 /** Wait for function to become stable.
    459  *
    460  */
    461 static void devman_drv_fun_wait_stable(ipc_call_t *icall, driver_t *drv)
    462 {
    463         fun_node_t *fun;
    464         dev_node_t *dev;
    465 
    466         fibril_rwlock_read_lock(&device_tree.rwlock);
    467 
    468         fun = find_fun_node(&device_tree, ipc_get_arg1(icall));
    469         if (fun == NULL) {
    470                 fibril_rwlock_read_unlock(&device_tree.rwlock);
    471                 async_answer_0(icall, ENOENT);
    472                 return;
    473         }
    474 
    475         if (fun->child == NULL) {
    476                 fibril_rwlock_read_unlock(&device_tree.rwlock);
    477                 fun_del_ref(fun);
    478                 async_answer_0(icall, EOK);
    479                 return;
    480         }
    481 
    482         dev = fun->child;
    483         dev_add_ref(dev);
    484 
    485         fibril_rwlock_read_unlock(&device_tree.rwlock);
    486 
    487         dev_wait_stable(dev);
    488         dev_del_ref(dev);
    489 
    490454        async_answer_0(icall, EOK);
    491455}
     
    677641                        devman_drv_fun_offline(&call, driver);
    678642                        break;
    679                 case DEVMAN_DRV_FUN_WAIT_STABLE:
    680                         devman_drv_fun_wait_stable(&call, driver);
    681                         break;
    682643                case DEVMAN_REMOVE_FUNCTION:
    683644                        devman_remove_function(&call);
Note: See TracChangeset for help on using the changeset viewer.