summaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-23 15:43:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-25 16:33:59 +0200
commit10fbd979bd636629e3d08dda70f837c3b4864b47 (patch)
tree1391b1723ed8f5ca58c8e65412c45c731ae7c608 /sound/usb
parent6d2d427e3b1266c3eab80cdb961c21b9f4fcdadf (diff)
downloadlinux-10fbd979bd636629e3d08dda70f837c3b4864b47.tar.bz2
sound: hiface: move to use usb_control_msg_send()
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. v2: API change of use usb_control_msg_send() Cc: Jaroslav Kysela <perex@perex.cz> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200914153756.3412156-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20200923134348.23862-14-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/hiface/pcm.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c
index a148caa5f48e..d942179ca095 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, GFP_KERNEL);
+ 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