mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-18 22:05:17 -05:00
pcm: return -ENOSYS when ops or fast_ops callback is NULL
function is allowed to continue until it checks for error variable, as to not conflict with original implementation flow for simple functions involving only one line, return error immediately in case callback is NULL Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
d7ee2a9a30
commit
3bf780dcc3
4 changed files with 148 additions and 31 deletions
|
|
@ -2356,7 +2356,10 @@ int snd_pcm_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
snd_output_printf(log, "REFINE called:\n");
|
||||
snd_pcm_hw_params_dump(params, log);
|
||||
#endif
|
||||
res = pcm->ops->hw_refine(pcm->op_arg, params);
|
||||
if (pcm->ops->hw_refine)
|
||||
res = pcm->ops->hw_refine(pcm->op_arg, params);
|
||||
else
|
||||
res = -ENOSYS;
|
||||
#ifdef REFINE_DEBUG
|
||||
snd_output_printf(log, "refine done - result = %i\n", res);
|
||||
snd_pcm_hw_params_dump(params, log);
|
||||
|
|
@ -2391,7 +2394,10 @@ int _snd_pcm_hw_params_internal(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
err = pcm->ops->hw_params(pcm->op_arg, params);
|
||||
if (pcm->ops->hw_params)
|
||||
err = pcm->ops->hw_params(pcm->op_arg, params);
|
||||
else
|
||||
err = -ENOSYS;
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue