lkml.org 
[lkml]   [2020]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 09/10] sound: hiface: move to use usb_control_msg_send()
Date
The usb_control_msg_send() call can return an error if a "short" write
happens, so move the driver over to using that call instead.

Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/hiface/pcm.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c
index a148caa5f48e..f9c924e3964e 100644
--- a/sound/usb/hiface/pcm.c
+++ b/sound/usb/hiface/pcm.c
@@ -156,16 +156,14 @@ static int hiface_pcm_set_rate(struct pcm_runtime *rt, unsigned int rate)
* This control message doesn't have any ack from the
* other side
*/
- ret = usb_control_msg(device, usb_sndctrlpipe(device, 0),
- HIFACE_SET_RATE_REQUEST,
- USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
- rate_value, 0, NULL, 0, 100);
- if (ret < 0) {
+ ret = usb_control_msg_send(device, 0,
+ HIFACE_SET_RATE_REQUEST,
+ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
+ rate_value, 0, NULL, 0, 100);
+ if (ret)
dev_err(&device->dev, "Error setting samplerate %d.\n", rate);
- return ret;
- }

- return 0;
+ return ret;
}

static struct pcm_substream *hiface_pcm_get_substream(struct snd_pcm_substream
--
2.28.0
\
 
 \ /
  Last update: 2020-09-02 13:04    [W:0.145 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site