From patchwork Mon Jan 18 11:14:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 366657 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=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 CBA36C43381 for ; Mon, 18 Jan 2021 11:18:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BF0720E65 for ; Mon, 18 Jan 2021 11:18:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390110AbhARLSS (ORCPT ); Mon, 18 Jan 2021 06:18:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:57296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390060AbhARLRB (ORCPT ); Mon, 18 Jan 2021 06:17:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 44A9D22ADC; Mon, 18 Jan 2021 11:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610968475; bh=ecfX8u3dIYs0RJOGkOhbjN1cqufD66uGoAOLyzMXpx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fxoobO9CQE2IYelllGDXfyKJMqdRQxsdaSD6cKjSjFdeKOr/g/WhCEZq2voLoflfc XIZSJSuJsM8vyu6g4Fhf54m6swN+OmTccWy9b55NHkSrKEHsDPrXwobpHxi5lyNhFz 2Kt5lfd2ZJFwRyLGBmA+t40PTA7CkKo03aJkKgbFoSwhK9F71YihvOKYnwnNub/Erl kunJfAbqUaOQUNl6tRCyoYt+AO1v/DxoAopNMTBDJrj6XXThj8FxQVCyR2xS4L0jlm /D1E37aR1yYVZ49vjRRTqHk13yxPxGf1jxLqgTCmP3tkq7cOA8gIl6ZU4HN4LuGZCr P9y9+dWBYf6wQ== Received: from johan by xi with local (Exim 4.93.0.4) (envelope-from ) id 1l1SUc-0001M0-0N; Mon, 18 Jan 2021 12:14:42 +0100 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Johan Hovold Subject: [PATCH 3/6] USB: serial: io_ti: drop short control-transfer check Date: Mon, 18 Jan 2021 12:14:23 +0100 Message-Id: <20210118111426.5147-4-johan@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210118111426.5147-1-johan@kernel.org> References: <20210118111426.5147-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org There's no need to check for short control transfers when sending data so remove the redundant sanity check. Signed-off-by: Johan Hovold --- drivers/usb/serial/io_ti.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index c327d4cf7928..0c4062698603 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -283,11 +283,7 @@ static int ti_vsend_sync(struct usb_device *dev, u8 request, u16 value, value, index, data, size, timeout); if (status < 0) return status; - if (status != size) { - dev_dbg(&dev->dev, "%s - wanted to write %d, but only wrote %d\n", - __func__, size, status); - return -ECOMM; - } + return 0; } From patchwork Mon Jan 18 11:14:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 366656 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=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 8BB4AC433E0 for ; Mon, 18 Jan 2021 11:18:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3EA93221F8 for ; Mon, 18 Jan 2021 11:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390108AbhARLSW (ORCPT ); Mon, 18 Jan 2021 06:18:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:57298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390061AbhARLRB (ORCPT ); Mon, 18 Jan 2021 06:17:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 60CF322B40; Mon, 18 Jan 2021 11:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610968475; bh=Jrf86bTZuvWL7qBEsZp5Tt7u1ih/Pww254arLofaApY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nXmqaJLNpOzmuYj0+XlqRg3Sx/kVpfjnQrLfekP1F6jEVxyfuSIwPZ8wO1Ra6RNVs txgiJOjlFhWef4C8ec9qTO5iCHAIgoTKu0FTedS4zSrQw3qCnytDzkr+/39N+73gj4 NwTCrYDl+Z4jKaOva3S05NiiwXWenkU835qX/0CYUnz5AR2Ivr2QENLActHCkdUKqd HvYWp2WiGPRdqSFeV7XbLg0QlmyF8Eii5rj8Er97ZxRnjcU3NOiSMCFgxxcP7EBte4 Xfp+iA8xNAqCCGhbqCeRdxb4Nwip5zXO0F/Q3B0Lh6ItE1/wGZiwUdh5TWV8SJU83p XtAOfI4ciu9YA== Received: from johan by xi with local (Exim 4.93.0.4) (envelope-from ) id 1l1SUc-0001M3-3y; Mon, 18 Jan 2021 12:14:42 +0100 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Johan Hovold Subject: [PATCH 4/6] USB: serial: io_ti: fix a debug-message copy-paste error Date: Mon, 18 Jan 2021 12:14:24 +0100 Message-Id: <20210118111426.5147-5-johan@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210118111426.5147-1-johan@kernel.org> References: <20210118111426.5147-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Fix a copy-paste error in the ti_vread_sync() debug message. Signed-off-by: Johan Hovold --- drivers/usb/serial/io_ti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 0c4062698603..0bbfa47e04b7 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -266,7 +266,7 @@ static int ti_vread_sync(struct usb_device *dev, __u8 request, if (status < 0) return status; if (status != size) { - dev_dbg(&dev->dev, "%s - wanted to write %d, but only wrote %d\n", + dev_dbg(&dev->dev, "%s - wanted to read %d, but only read %d\n", __func__, size, status); return -ECOMM; } From patchwork Mon Jan 18 11:14:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 366652 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=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 D3551C433E0 for ; Mon, 18 Jan 2021 20:07:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A719622CAD for ; Mon, 18 Jan 2021 20:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394175AbhARUHD (ORCPT ); Mon, 18 Jan 2021 15:07:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:57304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390067AbhARLRB (ORCPT ); Mon, 18 Jan 2021 06:17:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8D9B422BE9; Mon, 18 Jan 2021 11:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610968475; bh=03DJ2Xb4vsYJDuCHccpkiDCJVeNJxj4+xL4tAslZr+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQTmTJdlmDK0BfNq+Skgf8pvxf0R3fhCnS9e3o0zqhOv2aJOd93/r8yz7DdEfX0h9 i+ZIlfndlOnFDb+p4ZCfHeh7gi6yDL6x0c8lZ69mpFw3/3AC+eqdKjxVl5Mzux47RB HJ9uJLOVmKTVapRm//y61lGJkUlFfYmqRds2iuWhDG7HqqBcrtUwBbYw/jhb6olRXU i1rs/MX5M7brlDRBmMgWtFD4M+eEsDINcifQDafbsU+g1ITVVcYRICvxoVT/ykJZFY kMYy2Ga4NkJUYGBZsRZdinR77yGyxmp4sdQCSz66ILMpKm5vbdYNqfdsXLfrKhqA+z i6tAcDa5sDcIw== Received: from johan by xi with local (Exim 4.93.0.4) (envelope-from ) id 1l1SUc-0001MA-BB; Mon, 18 Jan 2021 12:14:42 +0100 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Johan Hovold Subject: [PATCH 6/6] USB: serial: f81534: drop short control-transfer check Date: Mon, 18 Jan 2021 12:14:26 +0100 Message-Id: <20210118111426.5147-7-johan@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210118111426.5147-1-johan@kernel.org> References: <20210118111426.5147-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org There's no need to check for short control transfers when sending data so remove the redundant sanity check. Signed-off-by: Johan Hovold --- drivers/usb/serial/f81534.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c index 5661fd03e545..dd7e55e822ef 100644 --- a/drivers/usb/serial/f81534.c +++ b/drivers/usb/serial/f81534.c @@ -235,11 +235,9 @@ static int f81534_set_register(struct usb_serial *serial, u16 reg, u8 data) USB_TYPE_VENDOR | USB_DIR_OUT, reg, 0, tmp, sizeof(u8), F81534_USB_TIMEOUT); - if (status > 0) { + if (status == sizeof(u8)) { status = 0; break; - } else if (status == 0) { - status = -EIO; } }