Skip to content

Commit

Permalink
sound: hiface: move to use usb_control_msg_send()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Takashi Iwai <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Sep 16, 2020
1 parent f7ef761 commit 119ae38
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions sound/usb/hiface/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 119ae38

Please sign in to comment.