mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-28 05:40:23 -04:00
control: Make ump_{endpoint|block}_info calls optional
Add the NULL check for ump_endpoint_info and ump_block_info calls.
Those can be NULl depending on the target.
Fixes: 81b0cf46d1 ("control: Add UMP Endpoint and Block info query support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
769d1db1b0
commit
fa673b719c
1 changed files with 7 additions and 2 deletions
|
|
@ -1293,7 +1293,10 @@ int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device)
|
|||
int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info)
|
||||
{
|
||||
assert(ctl && info);
|
||||
return ctl->ops->ump_endpoint_info(ctl, info);
|
||||
fprintf(stderr, "%s:%d\n", __func__, __LINE__);
|
||||
if (ctl->ops->ump_endpoint_info)
|
||||
return ctl->ops->ump_endpoint_info(ctl, info);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1305,7 +1308,9 @@ int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info)
|
|||
int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info)
|
||||
{
|
||||
assert(ctl && info);
|
||||
return ctl->ops->ump_block_info(ctl, info);
|
||||
if (ctl->ops->ump_block_info)
|
||||
return ctl->ops->ump_block_info(ctl, info);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue