summaryrefslogtreecommitdiff
path: root/drivers/staging/most
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2020-06-23 17:07:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-25 15:41:17 +0200
commitb1abd84d551b39c10ba86ffe8b27aaa659015e08 (patch)
treec227b21c8526a8298bb1435f05b10b4f60a863d7 /drivers/staging/most
parent36b67efe0cb3b33f6d58e1e86d5b2a02ff5ab387 (diff)
staging: most: sound: fix return values
This patch returns the proper values when reporting an error to the caller. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Link: https://lore.kernel.org/r/1592924855-25569-4-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r--drivers/staging/most/sound/sound.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c
index 80a8feba1662..467faa1cb6b3 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -278,6 +278,7 @@ static int pcm_open(struct snd_pcm_substream *substream)
struct channel *channel = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime;
struct most_channel_config *cfg = channel->cfg;
+ int ret;
channel->substream = substream;
@@ -290,11 +291,12 @@ static int pcm_open(struct snd_pcm_substream *substream)
}
}
- if (most_start_channel(channel->iface, channel->id, &comp)) {
+ ret = most_start_channel(channel->iface, channel->id, &comp);
+ if (ret) {
pr_err("most_start_channel() failed!\n");
if (cfg->direction == MOST_CH_TX)
kthread_stop(channel->playback_task);
- return -EBUSY;
+ return ret;
}
runtime->hw = channel->pcm_hardware;
@@ -444,7 +446,7 @@ static int split_arg_list(char *buf, u16 *ch_num, char **sample_res)
err:
pr_err("Bad PCM format\n");
- return -EIO;
+ return -EINVAL;
}
static const struct sample_resolution_info {
@@ -469,7 +471,7 @@ static int audio_set_hw_params(struct snd_pcm_hardware *pcm_hw,
goto found;
}
pr_err("Unsupported PCM format\n");
- return -EIO;
+ return -EINVAL;
found:
if (!ch_num) {
@@ -580,7 +582,7 @@ skip_adpt_alloc:
if (get_channel(iface, channel_id)) {
pr_err("channel (%s:%d) is already linked\n",
iface->description, channel_id);
- return -EINVAL;
+ return -EEXIST;
}
if (cfg->direction == MOST_CH_TX) {