Skip to contentSkip to conversation

staging: most: fix error return code in audio_probe_channel()

PATCH In review Wei Yongjun 4 participants 4 messages Sep 25, 2016 – Sep 26, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: most: fix error return code in audio_probe_channel()

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the audio_set_hw_params() error handling case instead of 0, as done elsewhere in this function.

---
 drivers/staging/most/aim-sound/sound.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/most/aim-sound/sound.c +2 -1
index 3dc625c..00f01c9 100644
@@ -607,7 +607,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
 	channel->id = channel_id;
 	init_waitqueue_head(&channel->playback_waitq);
 
-	if (audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg))
+	ret = audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg);
+	if (ret)
 		goto err_free_card;
 
 	snprintf(card->driver, sizeof(card->driver), "%s", DRIVER_NAME);
#1 lore raw
Quoted 15 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the audio_set_hw_params() error handling case instead of 0, as done elsewhere in this function.

---
 drivers/staging/most/aim-sound/sound.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/most/aim-sound/sound.c +0 -0
index 3dc625c..00f01c9 100644

drivers/staging/most/aim-sound/sound.c static int audio_probe_channel(struct most_interface *iface, int channel_id, · line 612

Quoted 7 lines
drivers/staging/most/aim-sound/sound.c +2 -1
@@ -607,7 +607,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
 	channel->id = channel_id;
 	init_waitqueue_head(&channel->playback_waitq);
 
-	if (audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg))
+	ret = audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg);
+	if (ret)
 		goto err_free_card;

Are you sure you want that error value? I need an ack from the driver maintainers before I can take this...

thanks,

greg k-h

#2 lore raw
In reply to Wei Yongjun
Quoted 6 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the audio_set_hw_params() error handling case instead of 0, as done elsewhere in this function.

Quoted 19 lines
---
 drivers/staging/most/aim-sound/sound.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/most/aim-sound/sound.c +2 -1
index 3dc625c..00f01c9 100644
@@ -607,7 +607,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
 	channel->id = channel_id;
 	init_waitqueue_head(&channel->playback_waitq);
 
-	if (audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg))
+	ret = audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg);
+	if (ret)
 		goto err_free_card;
 
 	snprintf(card->driver, sizeof(card->driver), "%s", DRIVER_NAME);
maintainer
#3 lore raw
Quoted 8 lines · On Mon, 26 Sep 2016 09:47:19 +0200 Andrey Shvetsov <[email protected]>…
Quoted 6 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the audio_set_hw_params() error handling case instead of 0, as done elsewhere in this function.

Quoted 21 lines
Quoted 20 lines
---
 drivers/staging/most/aim-sound/sound.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/most/aim-sound/sound.c +2 -1
index 3dc625c..00f01c9 100644
@@ -607,7 +607,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
 	channel->id = channel_id;
 	init_waitqueue_head(&channel->playback_waitq);
 
-	if (audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg))
+	ret = audio_set_hw_params(&channel->pcm_hardware, pcm_format, cfg);
+	if (ret)
 		goto err_free_card;
 
 	snprintf(card->driver, sizeof(card->driver), "%s", DRIVER_NAME);