From: Greg Kroah-Hartman Date: Mon, 14 Sep 2020 15:37:54 +0000 (+0200) Subject: sound: hiface: move to use usb_control_msg_send() X-Git-Tag: v5.10.7~1419^2~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=119ae38a5cdfbefdf926b34fbf65cd60dc82c95e;p=platform%2Fkernel%2Flinux-rpi.git 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. Cc: Jaroslav Kysela Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20200914153756.3412156-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c index a148caa..f9c924e 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