Skip to content

Commit

Permalink
ASoC: Intel: Skylake: Return negative error code
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
Reviewed-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
gune42 authored and broonie committed Apr 30, 2017
1 parent 9ed4aef commit 081dc8a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sound/soc/intel/skylake/skl-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 081dc8a

Please sign in to comment.