Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/mixer_iface.c

    r9bd4615 r1912b45  
    3333 */
    3434
    35 #include <ddf/driver.h>
    3635#include <errno.h>
    3736#include <audio_mixer_iface.h>
    3837
    3938#include "mixer.h"
    40 #include "sb16.h"
    41 
    42 static sb_mixer_t *fun_to_mixer(ddf_fun_t *fun)
    43 {
    44         sb16_t *sb = (sb16_t *)ddf_dev_data_get(ddf_fun_get_dev(fun));
    45         return &sb->mixer;
    46 }
    4739
    4840static int sb_get_info(ddf_fun_t *fun, const char** name, unsigned *items)
    4941{
    50         sb_mixer_t *mixer = fun_to_mixer(fun);
    51 
     42        assert(fun);
     43        const sb_mixer_t *mixer = ddf_fun_data_get(fun);
     44        assert(mixer);
    5245        if (name)
    5346                *name = sb_mixer_type_str(mixer->type);
     
    6154    unsigned *max_level)
    6255{
    63         sb_mixer_t *mixer = fun_to_mixer(fun);
    64         return sb_mixer_get_control_item_info(mixer, item, name, max_level);
     56        assert(fun);
     57        const sb_mixer_t *mixer = ddf_fun_data_get(fun);
     58        assert(mixer);
     59        return
     60            sb_mixer_get_control_item_info(mixer, item, name, max_level);
    6561}
    6662
    6763static int sb_set_item_level(ddf_fun_t *fun, unsigned item, unsigned value)
    6864{
    69         sb_mixer_t *mixer = fun_to_mixer(fun);
     65        assert(fun);
     66        const sb_mixer_t *mixer = ddf_fun_data_get(fun);
     67        assert(mixer);
    7068        return sb_mixer_set_control_item_value(mixer, item, value);
    7169}
     
    7371static int sb_get_item_level(ddf_fun_t *fun, unsigned item, unsigned *value)
    7472{
    75         sb_mixer_t *mixer = fun_to_mixer(fun);
     73        assert(fun);
     74        const sb_mixer_t *mixer = ddf_fun_data_get(fun);
     75        assert(mixer);
    7676        return sb_mixer_get_control_item_value(mixer, item, value);
    7777}
Note: See TracChangeset for help on using the changeset viewer.