From patchwork Mon Sep 14 15:37:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11774319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3147914F6 for ; Mon, 14 Sep 2020 15:43:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1788421973 for ; Mon, 14 Sep 2020 15:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600098189; bh=tGgg30b0UwGAiVeeMU334OIR6bWHk4P6xBpiFv81zpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=V2tnXewDF06+GwRITsfaVCp6mLY1jbAOY2T+jR4WvsLuv8N+Ecag/Q534rAvGyxlO rQYVq6K/Kv2XtpYAs08yf+5fLtPILZ3eY5is4rBCp/eBp24CPAMh+Ei0pnWWNDoEsK +GJrDnMhkkf9pLSXYUIX5BHoNQI2+cBNcku7qwzs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726500AbgINPm6 (ORCPT ); Mon, 14 Sep 2020 11:42:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:48034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbgINPik (ORCPT ); Mon, 14 Sep 2020 11:38:40 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB91322204; Mon, 14 Sep 2020 15:38:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600097908; bh=tGgg30b0UwGAiVeeMU334OIR6bWHk4P6xBpiFv81zpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lnWE3OQEG5NmPV6Q3zBx67lv6nmYQZgaDVZ68K1p7Fv13rDNI9D/au2COJEFfHxty LV8TMYWiHkYFQEcdCLd+zGnRfQIu31e3pOmzxi0wl8zvMyB/+eQzD8tjB+IiTZjjcZ nYXusKOZULgAsa/Sv40W8NCHgQFBzWxdnPxu8nbQ= From: Greg Kroah-Hartman To: himadrispandya@gmail.com, dvyukov@google.com, linux-usb@vger.kernel.org Cc: perex@perex.cz, tiwai@suse.com, stern@rowland.harvard.ed, linux-kernel@vger.kernel.org, marcel@holtmann.org, johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org, alsa-devel@alsa-project.org, Greg Kroah-Hartman , Takashi Iwai Subject: [PATCH v3 09/11] sound: hiface: move to use usb_control_msg_send() Date: Mon, 14 Sep 2020 17:37:54 +0200 Message-Id: <20200914153756.3412156-10-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200914153756.3412156-1-gregkh@linuxfoundation.org> References: <20200914153756.3412156-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 Cc: alsa-devel@alsa-project.org Reviewed-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- v3: - no change from v2 v2: - Added reviewed-by from Takashi 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