ASoC: Intel: Skylake: Return negative error code

skl_tplg_add_pipe() returned EEXIST instead of negative EEXIST, so fix that
and handle the return value as well.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Guneshwor Singh 2017-04-27 12:21:22 +05:30 committed by Mark Brown
parent 9ed4aefe6f
commit 081dc8ab46
1 changed files with 7 additions and 5 deletions

View File

@ -1711,7 +1711,7 @@ static int skl_tplg_add_pipe(struct device *dev,
list_for_each_entry(ppl, &skl->ppl_list, node) {
if (ppl->pipe->ppl_id == tkn_elem->value) {
mconfig->pipe = ppl->pipe;
return EEXIST;
return -EEXIST;
}
}
@ -2003,11 +2003,13 @@ static int skl_tplg_get_token(struct device *dev,
ret = skl_tplg_add_pipe(dev,
mconfig, skl, tkn_elem);
if (ret < 0)
if (ret < 0) {
if (ret == -EEXIST) {
is_pipe_exists = 1;
break;
}
return is_pipe_exists;
if (ret == EEXIST)
is_pipe_exists = 1;
}
break;