From patchwork Sun Jul 10 16:44:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 589331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42F46CCA485 for ; Sun, 10 Jul 2022 16:45:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229463AbiGJQpT (ORCPT ); Sun, 10 Jul 2022 12:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiGJQpR (ORCPT ); Sun, 10 Jul 2022 12:45:17 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F3F213D47; Sun, 10 Jul 2022 09:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1657471496; bh=ZCtUUJ2Kv6ZjMvVyjn9DfppbcpxqyAsK7G92RHDx1TY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=JGGkWd/jM0pG0LWxjd7k9w7t5glUGXZzlhWE9RRWZZyaFgLTnxEDEP8vU+2dh3MHf ZdmE1R1joGkfVkyy2argi/BCJD9nHxat/2pquIoNGhq/f1/V3zhXOvJDefFMSi79sZ WNQnHNW53ZheDKXVac4lpxPUyY1iRAmXJvKBYNcU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.243]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MVNB1-1o2A9Q49I7-00SQZn; Sun, 10 Jul 2022 18:44:56 +0200 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: ilpo.jarvinen@linux.intel.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, andriy.shevchenko@linux.intel.com, vz@mleia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v4 2/8] serial: ar933x: Remove superfluous code in ar933x_config_rs485() Date: Sun, 10 Jul 2022 18:44:36 +0200 Message-Id: <20220710164442.2958979-3-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710164442.2958979-1-LinoSanfilippo@gmx.de> References: <20220710164442.2958979-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:r71Y1Fa5+bqyqmrpIVp46cCXbjgLbualWjO7kFiDHpXTHV4AgxL y9UmxiUFpQ1S2+KC9WGMkyl8taGMpgAC5JRJ6p6U61xQF3DRerAUoyF68q/NFSmDsToCm7j dtIIzPXpVfXwVyHzsmEKcSGpNZTmiIhcnBDATLy+L2gR3aXFgt2VvLS/UKv3DzPUVn7Fci4 jngSzgZzyFVM81n3hVcUA== X-UI-Out-Filterresults: notjunk:1;V03:K0:FBqw/QsEZZ8=:oJNlPyo1dppbsym9tRb28/ YOixVQmOZWGxJhk1emE83AqsvTTTXRO83v+Lrk0N+0nIXqgRSwhW11pXxBJMmL54yknZ//Wep whPsyoJhXW1ZIDNQsTKEqnwAdsBq+n/SNx3zRC1cKW4Eqd8z5QFzUv+fQ/61A1bZI7bYRFYAi Alj5VQkzNpk9SV2OlMWItiOhtt2t4uyRfOVcK06VF7FTRWkaHWbuUfCmtddCV7hdVdomYOWxp gJ42E6tB7a9l9KdzVvHxu8CLggJ6ukPV5B1M1l2Wsw0MBfttJd3huUjwch2SmWSlYSy/FNwEF O+uR0RftEelJg6Q6UTp39eicHUI0Z7ek2RNXWq0wNRGxfPWeEOfimIoamoqq/48m3dJpNE7S5 l7mlvc1gMJsL/dSimjfVavELguSnEgVhw6xnfGNVsA3BQf4vQ+haENamd8lb+fjdA99P7p5bi e7SLqQj+U7YjotI8kwPlkAotDPTGlhFV3sKIbzOz02JdrClaSaq0PLYxswGx/q48s8T7chIbT 0p37B4eIEITHOjMcXoo3cIOyVfmHylm/5xKBZc0ZoWW52hmOVhyWNsnWexDC+mR4UxKerrn5H IefXm2ZB/6/g+bMo0OyVRY2Ge6H+qvkSwqNOXYNbMKNKEGAbxZ600vaZcMKPM22J+gBIT6Jqt NyUubsMeAqOzH3Ym3iCuEb9v89wTR+jEPM4mc4/0lZtcffSafOLKygaM5b449P3v5GFcpoyiW y5cVm2v8VMDlSdRptPwEAriRuQPNmE/qgRilQMN0yVXHnwXX3RdpFvAdQHTE9s5LYPxIaVamb njwuI2xjsuWrVLN/f30uE8ebjoWYX+6lGdTvbYb8Rgfz4KbpnpfJO9BCVheeodlNo8VYzWoM4 E3O5498CjdmUvbWwkuo4IS/jfGX/z0CsiQ1IlvY7GOuN77xqIJd+wKrC4GCGmhe4XZSDW81S4 dWXC0v35YUA+0dxMGB875LZP/du92xWEer9Z5OYGixv8ya1v5eMGMTQq4NkfJDxXSGqiF80rX fPV3K8/F33g5rhjbLxdyjqTQOd2rxqVdVnlpOz9C7O0hyyySR1tLwtMwz5kGFFOvm3/8MFbVW dNQ/hKHHmZWWwPY+eSw3kGiizegQ+nBikhchkziCuZKwYIisNxCl+zjeA== Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Lino Sanfilippo In ar933x_config_rs485() the check for the RTS GPIO is not needed since in case the GPIO is not available at driver init ar933x_no_rs485 is assigned to port->rs485_supported and this function is never called. So remove the check. Also in uart_set_rs485_config() the serial core already assigns the passed serial_rs485 struct to the uart port. So remove the assignment in the drivers rs485_config() function to avoid redundancy. Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/ar933x_uart.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index f7b4638d69e5..32caeac12985 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -583,15 +583,6 @@ static const struct uart_ops ar933x_uart_ops = { static int ar933x_config_rs485(struct uart_port *port, struct ktermios *termios, struct serial_rs485 *rs485conf) { - struct ar933x_uart_port *up = - container_of(port, struct ar933x_uart_port, port); - - if ((rs485conf->flags & SER_RS485_ENABLED) && - !up->rts_gpiod) { - dev_err(port->dev, "RS485 needs rts-gpio\n"); - return 1; - } - port->rs485 = *rs485conf; return 0; }