Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7d276395 in mainline


Ignore:
Timestamp:
2014-07-09T11:24:34Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
8e4a408
Parents:
0ca15eb7
Message:

Remove one case of improper use of devman_device_connect().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mixerctl/mixerctl.c

    r0ca15eb7 r7d276395  
    3535#include <assert.h>
    3636#include <errno.h>
     37#include <loc.h>
    3738#include <str_error.h>
    3839#include <str.h>
    39 #include <devman.h>
    4040#include <audio_mixer_iface.h>
    4141#include <stdio.h>
    4242
    43 #define DEFAULT_DEVICE "/hw/pci0/00:01.0/sb16/control"
     43#define DEFAULT_SERVICE "devices/\\hw\\pci0\\00:01.0\\sb16\\control"
    4444
    4545/**
     
    128128int main(int argc, char *argv[])
    129129{
    130         const char *device = DEFAULT_DEVICE;
     130        const char *service = DEFAULT_SERVICE;
    131131        void (*command)(async_exch_t *, int, char*[]) = NULL;
    132132
     
    134134                command = set_level;
    135135                if (argc == 5)
    136                         device = argv[1];
     136                        service = argv[1];
    137137        }
    138138
     
    140140                command = get_level;
    141141                if (argc == 4)
    142                         device = argv[1];
     142                        service = argv[1];
    143143        }
    144144
    145145        if ((argc == 2 && command == NULL))
    146                 device = argv[1];
     146                service = argv[1];
    147147
    148148
    149         devman_handle_t mixer_handle;
    150         int ret = devman_fun_get_handle(device, &mixer_handle, 0);
    151         if (ret != EOK) {
    152                 printf("Failed to get device(%s) handle: %s.\n",
    153                     device, str_error(ret));
     149        service_id_t mixer_sid;
     150        int rc = loc_service_get_id(service, &mixer_sid, 0);
     151        if (rc != EOK) {
     152                printf("Failed to resolve service '%s': %s.\n",
     153                    service, str_error(rc));
    154154                return 1;
    155155        }
    156156
    157         async_sess_t *session = devman_device_connect(
    158             EXCHANGE_ATOMIC, mixer_handle, IPC_FLAG_BLOCKING);
     157        async_sess_t *session = loc_service_connect(
     158            EXCHANGE_ATOMIC, mixer_sid, 0);
    159159        if (!session) {
    160                 printf("Failed to connect to device.\n");
     160                printf("Failed connecting mixer service '%s'.\n", service);
    161161                return 1;
    162162        }
Note: See TracChangeset for help on using the changeset viewer.