From patchwork Mon Jan 18 11:14:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 365875 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 AA0CBC433DB 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 69C2522226 for ; Mon, 18 Jan 2021 11:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390120AbhARLSZ (ORCPT ); Mon, 18 Jan 2021 06:18:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:57290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390066AbhARLRB (ORCPT ); Mon, 18 Jan 2021 06:17:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1EC0220E65; 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=NjUQ79cLJwXWs5mX+phDrSbtcH57D8CjxBUMCpDkGTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hZCy9xZ+bAbCNZMK+H1sSqsaZDTD00bs0Kw8++DRbgfn3oSeUCDXIosLaKXugb1Ey czMa08/KrY6e7HIUngzNY6RSYtvejGVlba+LaIhcXzpi1HxDadM92q0SIPtiQjs71t ffwfDnE9QDxnhpss1HgGhrPJZEugKrk7iEI/W+ENPniuOXUs20VnE758ncULfrXmzL 8hwQzO2CiYZNnW/pBHKlen7d7HByG2ngeXa0F8Bh+/t+maMzasQazjZNuCrALWJaU8 0HAyyj9YEojyKo4ZsodOdO37sf4NgIxsMPgDVIGZNOkZE4aFWtECf2y7/NODekIgcj SlgeK1gbmme5w== Received: from johan by xi with local (Exim 4.93.0.4) (envelope-from ) id 1l1SUb-0001Lu-QR; Mon, 18 Jan 2021 12:14:41 +0100 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Johan Hovold Subject: [PATCH 1/6] USB: serial: mxuport: drop short control-transfer check Date: Mon, 18 Jan 2021 12:14:21 +0100 Message-Id: <20210118111426.5147-2-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/mxuport.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c index 5d38c2a0f590..eb45a9b0005c 100644 --- a/drivers/usb/serial/mxuport.c +++ b/drivers/usb/serial/mxuport.c @@ -261,13 +261,6 @@ static int mxuport_send_ctrl_data_urb(struct usb_serial *serial, return status; } - if (status != size) { - dev_err(&serial->interface->dev, - "%s - short write (%d / %zd)\n", - __func__, status, size); - return -EIO; - } - return 0; } From patchwork Mon Jan 18 11:14:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 365876 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 681CEC433DB 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 2B0E8221F8 for ; Mon, 18 Jan 2021 11:18:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390107AbhARLSJ (ORCPT ); Mon, 18 Jan 2021 06:18:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:57292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390059AbhARLRB (ORCPT ); Mon, 18 Jan 2021 06:17:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EB2822226; 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=ZQ07/waqfaC2N5t4AtnlnRpzU0Lw+vRibiaKx/GbcPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PGzzMgmUF1F2zbk4etrkRZGTNFyjxt8XEt0KJOs+fqtdKlyI/DJfAM5C3ldXFDInG mPilrfDN/4heZRPPo0V8xZYp7vTuSBB64XSYtByI908tUHhLaKgO/Au3ddBe2XGyTM nwirypFYIeceVj6KqhRhJnrqv1b9iv5T9cS/R4OvvJyx9p3Kvdozt6p4yTj8GxZ5Ig Um8SbdtQKVmHx4VCx1uBM4Zsi5WyQotfR6mihHVJ5yXARTlazPFtSdUmgTeItCmg0i CGyQJ7hkjJlKC4R+82z6C07ErM32vtyHykPmGNBCAg8pVsPMFwtqmwRfCj2L0cxC6p H50jZOFdIcMDQ== Received: from johan by xi with local (Exim 4.93.0.4) (envelope-from ) id 1l1SUb-0001Lw-TM; Mon, 18 Jan 2021 12:14:41 +0100 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Johan Hovold Subject: [PATCH 2/6] USB: serial: upd78f0730: drop short control-transfer check Date: Mon, 18 Jan 2021 12:14:22 +0100 Message-Id: <20210118111426.5147-3-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/upd78f0730.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/serial/upd78f0730.c b/drivers/usb/serial/upd78f0730.c index 0a2268c479af..1ca9c1881621 100644 --- a/drivers/usb/serial/upd78f0730.c +++ b/drivers/usb/serial/upd78f0730.c @@ -145,14 +145,11 @@ static int upd78f0730_send_ctl(struct usb_serial_port *port, kfree(buf); - if (res != size) { + if (res < 0) { struct device *dev = &port->dev; dev_err(dev, "failed to send control request %02x: %d\n", *(u8 *)data, res); - /* The maximum expected length of a transfer is 6 bytes */ - if (res >= 0) - res = -EIO; return res; } From patchwork Mon Jan 18 11:13:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 365871 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 A3ABCC433DB for ; Mon, 18 Jan 2021 20:07:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70CB622D49 for ; Mon, 18 Jan 2021 20:07:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394179AbhARUHF (ORCPT ); Mon, 18 Jan 2021 15:07:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:57288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390062AbhARLRB (ORCPT ); Mon, 18 Jan 2021 06:17:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EFEC022AAA; Mon, 18 Jan 2021 11:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610968420; bh=M9zxGtlH9hPe41bPLOZaX41IfFeTJfowhNd7mr+NTEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uxzsl+0ZOPu/MCyzlRcT/RvmLkjwSiG1PDMwgptXLOo1VwXaUP8WPheck5sAfb29q OGVEAAdSvhKJx/TESrWAxoHYLvuQIxVZj2+IS11WzBLy8h1m7Mt/7+NIR/cRy/frbJ Cdup7dl3ykSNNTKgr3+gYV0awPXvO7ot6cmRDNfFd0vSjctkre+DYsLQ/9bqKHsbG/ SrneOi5L+2AhzlsBlUapjLVCGRcANzCQKTxksYQRKDeZFE+StVuV/x1lmJjkb3EnL6 9VgbEkcIZISZ/0CJAZZvuBJ/TiFQsxWQMrgpgPcuWYoiYXivapq7ja96zrarQME8Yj RMZQcLO6I2Pig== Received: from johan by xi with local (Exim 4.93.0.4) (envelope-from ) id 1l1STi-0001KT-5a; Mon, 18 Jan 2021 12:13:46 +0100 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: Sheng Long Wang , Wang Sheng Long , Greg Kroah-Hartman , Johan Hovold Subject: [PATCH 3/6] USB: serial: cp210x: update control-characters on every change Date: Mon, 18 Jan 2021 12:13:28 +0100 Message-Id: <20210118111331.5048-4-johan@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210118111331.5048-1-johan@kernel.org> References: <20210118111331.5048-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Update the XON/XOFF control characters also when no other flow-control flag has changed and software flow control is enabled. Signed-off-by: Johan Hovold --- drivers/usb/serial/cp210x.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index ee0139eb6636..4f90573c0d2b 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -1113,11 +1113,13 @@ static int cp210x_set_chars(struct usb_serial_port *port, static bool cp210x_termios_change(const struct ktermios *a, const struct ktermios *b) { - bool iflag_change; + bool iflag_change, cc_change; iflag_change = ((a->c_iflag ^ b->c_iflag) & (INPCK | IXON | IXOFF)); + cc_change = a->c_cc[VSTART] != b->c_cc[VSTART] || + a->c_cc[VSTOP] != b->c_cc[VSTOP]; - return tty_termios_hw_change(a, b) || iflag_change; + return tty_termios_hw_change(a, b) || iflag_change || cc_change; } static void cp210x_set_flow_control(struct tty_struct *tty, @@ -1132,7 +1134,9 @@ static void cp210x_set_flow_control(struct tty_struct *tty, if (old_termios && C_CRTSCTS(tty) == (old_termios->c_cflag & CRTSCTS) && I_IXON(tty) == (old_termios->c_iflag & IXON) && - I_IXOFF(tty) == (old_termios->c_iflag & IXOFF)) { + I_IXOFF(tty) == (old_termios->c_iflag & IXOFF) && + START_CHAR(tty) == old_termios->c_cc[VSTART] && + STOP_CHAR(tty) == old_termios->c_cc[VSTOP]) { return; } From patchwork Mon Jan 18 11:13:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 366651 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 C40A5C433DB for ; Mon, 18 Jan 2021 20:07:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D3A322CAD for ; Mon, 18 Jan 2021 20:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389179AbhARUHU (ORCPT ); Mon, 18 Jan 2021 15:07:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:56318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389972AbhARLOU (ORCPT ); Mon, 18 Jan 2021 06:14:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C1C2C229C6; Mon, 18 Jan 2021 11:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610968419; bh=J2YsekzpW29kxoTz9MkMUaODOQ7MYOALSTt4K9PoRVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vtf957s1eLR0KOkV6JgklLrJCZT+GJTD3y1A+IyfYdJ5jcPNFnuGdK3OEEfECSWT8 ABtLELY3b/FqXEDFQFFKX2gETIb4KPJgvy8+Zj3yAFEbIpn2YhxVMdhRvumW+7LfZF Ms/e5q1scQtPjplCV33yEumo7/ARfCMUqOPSgj4bdVIEhggtGjswwd1allzWqHx9V2 2cDuDguNqkk2C4CV5OVTemInsgrqe3FlMRkL6xvLmz4TliPKXbnqf2pr5Y0uw3UgN/ OuOTrUOEf7NvyUguXR/pblAU4ly+UncqZHiSNd8FHWipMfheqeqtjtLhEs8NCMdvq4 4b5SYo79QOC7Q== Received: from johan by xi with local (Exim 4.93.0.4) (envelope-from ) id 1l1STi-0001KX-96; Mon, 18 Jan 2021 12:13:46 +0100 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: Sheng Long Wang , Wang Sheng Long , Greg Kroah-Hartman , Johan Hovold Subject: [PATCH 4/6] USB: serial: cp210x: drop short control-transfer checks Date: Mon, 18 Jan 2021 12:13:29 +0100 Message-Id: <20210118111331.5048-5-johan@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210118111331.5048-1-johan@kernel.org> References: <20210118111331.5048-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 checks. Signed-off-by: Johan Hovold --- drivers/usb/serial/cp210x.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 4f90573c0d2b..360398665c17 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -674,16 +674,13 @@ static int cp210x_write_reg_block(struct usb_serial_port *port, u8 req, kfree(dmabuf); - if (result == bufsize) { - result = 0; - } else { + if (result < 0) { dev_err(&port->dev, "failed set req 0x%x size %d status: %d\n", req, bufsize, result); - if (result >= 0) - result = -EIO; + return result; } - return result; + return 0; } /* @@ -720,17 +717,14 @@ static int cp210x_write_vendor_block(struct usb_serial *serial, u8 type, kfree(dmabuf); - if (result == bufsize) { - result = 0; - } else { + if (result < 0) { dev_err(&serial->interface->dev, "failed to set vendor val 0x%04x size %d: %d\n", val, bufsize, result); - if (result >= 0) - result = -EIO; + return result; } - return result; + return 0; } #endif From patchwork Mon Jan 18 11:14:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 365874 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 C879EC433E6 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 90DDA223E8 for ; Mon, 18 Jan 2021 11:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390123AbhARLS1 (ORCPT ); Mon, 18 Jan 2021 06:18:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:57300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390063AbhARLRB (ORCPT ); Mon, 18 Jan 2021 06:17:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 80D3422B4E; 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=ZmiwXvU1fPkhwjAFY6wchIWp1xM+P3XaMY4OdYYItgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=frZAJ8h7VYXTMeR0QnRgda1XE9XKXd2JUBZPtCKsZ8gOyy4LYD1DT3LpdC0KfCLel eo/r1eY5tkVLkH8Lug47HZWV2bh8h/7vrCxZSKvPOsX0ZGppTSUpY7r177THIooL4n iUguEA770KBcM0eEQ65XSZeljSCyrhiLf7lgkjwMnELF01nI9dWYM+2pKx9gk1pedh 2AevsTqpx0KfjSrT1iOKSVn4AKwaevTdPsNYdyLLp2CmqBuxDv+avyMJL8yMkdtxW9 iF0HlGdLDOhzkwFsoQK3o/dQISAmgCozqtDmOn4Dbzvt4YiUgOaWijrOejR0Sz9f7B jbOg7s/No90AQ== Received: from johan by xi with local (Exim 4.93.0.4) (envelope-from ) id 1l1SUc-0001M7-7e; 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 5/6] USB: serial: f81232: drop short control-transfer checks Date: Mon, 18 Jan 2021 12:14:25 +0100 Message-Id: <20210118111426.5147-6-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 checks. Signed-off-by: Johan Hovold --- drivers/usb/serial/f81232.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index 0c7eacc630e0..6a8f39147d8e 100644 --- a/drivers/usb/serial/f81232.c +++ b/drivers/usb/serial/f81232.c @@ -192,13 +192,9 @@ static int f81232_set_register(struct usb_serial_port *port, u16 reg, u8 val) tmp, sizeof(val), USB_CTRL_SET_TIMEOUT); - if (status != sizeof(val)) { + if (status < 0) { dev_err(&port->dev, "%s failed status: %d\n", __func__, status); - - if (status < 0) - status = usb_translate_errors(status); - else - status = -EIO; + status = usb_translate_errors(status); } else { status = 0; } @@ -886,10 +882,6 @@ static int f81534a_ctrl_set_register(struct usb_interface *intf, u16 reg, status = usb_translate_errors(status); if (status == -EIO) continue; - } else if (status != size) { - /* Retry on short transfers */ - status = -EIO; - continue; } else { status = 0; } From patchwork Mon Jan 18 11:13:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 365877 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, 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 E5AB0C433DB for ; Mon, 18 Jan 2021 11:18:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3CC2620E65 for ; Mon, 18 Jan 2021 11:18:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390027AbhARLSC (ORCPT ); Mon, 18 Jan 2021 06:18:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:56320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389976AbhARLOU (ORCPT ); Mon, 18 Jan 2021 06:14:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFF87223E8; Mon, 18 Jan 2021 11:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610968419; bh=9ZqGcNXCzHYMy8Jgu/UaRqxwkpOxvrpuzYugqsnYMDU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aEvOvpbiTYj/7zu6lYXUJp8YODj6S/WeATWHCPM+qZehdmSrww8Pa7jUD0lDdf2d6 WmnQ7+Yyo8tofe7fn4MwzaZGbmWPH08I77x4tT62tpSuS4JuVOjMeQh7qrVphJLn7c mWeTMYrveszL/Uk5+7Q+Fr5frjIsfBsKWpvD92cI2IfbPFuanEGWlhzmiK9PkElvgs RmdWPUyfNG2c4ZCXwMS3auclrr+TTiv1XQFw/q/UkAmjO4WoVyxfFCYPXBeCWFJqXV AJSf+T1pF0NuU9/1ITKNMqZn2TGYOGepP4OmJSH5H095YpG4YqFocfCZlOyaK6SlFs Mp9NDjJbP+68A== Received: from johan by xi with local (Exim 4.93.0.4) (envelope-from ) id 1l1STi-0001Kk-Fv; Mon, 18 Jan 2021 12:13:46 +0100 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: Sheng Long Wang , Wang Sheng Long , Greg Kroah-Hartman , Johan Hovold Subject: [PATCH 6/6] USB: serial: cp210x: add copyright notice Date: Mon, 18 Jan 2021 12:13:31 +0100 Message-Id: <20210118111331.5048-7-johan@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210118111331.5048-1-johan@kernel.org> References: <20210118111331.5048-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add a copyright notice for myself. Signed-off-by: Johan Hovold --- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 0d0fc1f9e99b..d813a052738f 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -3,6 +3,7 @@ * Silicon Laboratories CP210x USB to RS232 serial adaptor driver * * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) + * Copyright (C) 2010-2021 Johan Hovold (johan@kernel.org) * * Support to set flow control line levels using TIOCMGET and TIOCMSET * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow