Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/devman.c

    r622dea8 r96b02eb9  
    4242#include <devman.h>
    4343#include <async.h>
    44 #include <fibril_synch.h>
    4544#include <errno.h>
    4645#include <malloc.h>
     
    5150static int devman_phone_client = -1;
    5251
    53 static FIBRIL_MUTEX_INITIALIZE(devman_phone_mutex);
    54 
    5552int devman_get_phone(devman_interface_t iface, unsigned int flags)
    5653{
    5754        switch (iface) {
    5855        case DEVMAN_DRIVER:
    59                 fibril_mutex_lock(&devman_phone_mutex);
    60                 if (devman_phone_driver >= 0) {
    61                         fibril_mutex_unlock(&devman_phone_mutex);
     56                if (devman_phone_driver >= 0)
    6257                        return devman_phone_driver;
    63                 }
    6458               
    6559                if (flags & IPC_FLAG_BLOCKING)
    66                         devman_phone_driver = async_connect_me_to_blocking(
    67                             PHONE_NS, SERVICE_DEVMAN, DEVMAN_DRIVER, 0);
     60                        devman_phone_driver = ipc_connect_me_to_blocking(PHONE_NS,
     61                            SERVICE_DEVMAN, DEVMAN_DRIVER, 0);
    6862                else
    69                         devman_phone_driver = async_connect_me_to(PHONE_NS,
     63                        devman_phone_driver = ipc_connect_me_to(PHONE_NS,
    7064                            SERVICE_DEVMAN, DEVMAN_DRIVER, 0);
    7165               
    72                 fibril_mutex_unlock(&devman_phone_mutex);
    7366                return devman_phone_driver;
    7467        case DEVMAN_CLIENT:
    75                 fibril_mutex_lock(&devman_phone_mutex);
    76                 if (devman_phone_client >= 0) {
    77                         fibril_mutex_unlock(&devman_phone_mutex);
     68                if (devman_phone_client >= 0)
    7869                        return devman_phone_client;
    79                 }
    8070               
    8171                if (flags & IPC_FLAG_BLOCKING)
    82                         devman_phone_client = async_connect_me_to_blocking(
    83                             PHONE_NS, SERVICE_DEVMAN, DEVMAN_CLIENT, 0);
     72                        devman_phone_client = ipc_connect_me_to_blocking(PHONE_NS,
     73                            SERVICE_DEVMAN, DEVMAN_CLIENT, 0);
    8474                else
    85                         devman_phone_client = async_connect_me_to(PHONE_NS,
     75                        devman_phone_client = ipc_connect_me_to(PHONE_NS,
    8676                            SERVICE_DEVMAN, DEVMAN_CLIENT, 0);
    87                         fibril_mutex_unlock(&devman_phone_mutex);
    88                
    89                 fibril_mutex_unlock(&devman_phone_mutex);
     77               
    9078                return devman_phone_client;
    9179        default:
     
    242230       
    243231        if (flags & IPC_FLAG_BLOCKING) {
    244                 phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,
     232                phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,
    245233                    DEVMAN_CONNECT_TO_DEVICE, handle);
    246234        } else {
    247                 phone = async_connect_me_to(PHONE_NS, SERVICE_DEVMAN,
     235                phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAN,
    248236                    DEVMAN_CONNECT_TO_DEVICE, handle);
    249237        }
     
    257245       
    258246        if (flags & IPC_FLAG_BLOCKING) {
    259                 phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,
     247                phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,
    260248                    DEVMAN_CONNECT_TO_PARENTS_DEVICE, handle);
    261249        } else {
    262                 phone = async_connect_me_to(PHONE_NS, SERVICE_DEVMAN,
     250                phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAN,
    263251                    DEVMAN_CONNECT_TO_PARENTS_DEVICE, handle);
    264252        }
Note: See TracChangeset for help on using the changeset viewer.