From patchwork Wed Sep 23 13:43:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 297531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86774C2D0A8 for ; Wed, 23 Sep 2020 13:44:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2FF9A21D92 for ; Wed, 23 Sep 2020 13:44:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="C0f4Huxo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbgIWNoX (ORCPT ); Wed, 23 Sep 2020 09:44:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:33568 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726662AbgIWNoU (ORCPT ); Wed, 23 Sep 2020 09:44:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1600868658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=J8kb2Y6xVaUgs3fR1w109xfB+LPi5dm748aQ+V80RFQ=; b=C0f4HuxoJGjDTusjunJxM43U+Mb5MGuZvObd4nVGyLiCCN0kqn4x3Zn781VrdoQxk2FnHo gYUSQ9lW95TKHb/2648cYbbo1/4FuwGQUbeB0stf62cNqDVCyV0kBsWDrYdS61fEakfY4C h/buFd6zpDSEHax74R08lDZlYFyfaq4= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B2569AD57; Wed, 23 Sep 2020 13:44:55 +0000 (UTC) From: Oliver Neukum To: himadrispandya@gmail.com, gregKH@linuxfoundation.org, stern@rowland.harvard.edu, linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Jaroslav Kysela Subject: [RFC 13/14] sound: hiface: move to use usb_control_msg_send() Date: Wed, 23 Sep 2020 15:43:47 +0200 Message-Id: <20200923134348.23862-14-oneukum@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200923134348.23862-1-oneukum@suse.com> References: <20200923134348.23862-1-oneukum@suse.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Greg Kroah-Hartman 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 Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20200914153756.3412156-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- 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..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