From patchwork Sun Jul 10 15:03:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 590022 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 BC2C1CCA479 for ; Sun, 10 Jul 2022 15:04:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbiGJPEF (ORCPT ); Sun, 10 Jul 2022 11:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbiGJPDy (ORCPT ); Sun, 10 Jul 2022 11:03:54 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C175464D9; Sun, 10 Jul 2022 08:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1657465410; bh=ZCtUUJ2Kv6ZjMvVyjn9DfppbcpxqyAsK7G92RHDx1TY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=jw6XYssfLAglNQGipFi5jLqgdiiMnJ8TdSA/TbmLrPe8j8L88EeCgfX/211cpKG9o 8Mg8/kyqpcQTVsftNZUCF0EYVIF07y88+W3UdQ73qM+ror61c2hvGkBqnp3E3b7Y/u 6f6oyDA5R8SFcTjvH+9zWPqFGpCLkDAUh3wQP9VM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.243]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M9o1v-1oGLtk43TZ-005pJ2; Sun, 10 Jul 2022 17:03:30 +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 v3 2/8] serial: ar933x: Remove superfluous code in ar933x_config_rs485() Date: Sun, 10 Jul 2022 17:03:16 +0200 Message-Id: <20220710150322.2846170-3-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710150322.2846170-1-LinoSanfilippo@gmx.de> References: <20220710150322.2846170-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:5+Dw2l9RAjF2laNlcFk/awBskO8xgbsTtkjwp1p4X1ML/yUYLsC uYpA5UA9E/xyAWxjOhpkVLgrmHBBbK800tPqkHHZWFAl4NPI3aifM0R34o9PONbwnJWOTn8 XPwJqHpvgmWfa67n+dTla0usEBzOoMcgSHR6lIjnvchK/47CbWjW4t2rO8+YHxNdGajjl/s KO5b3VUol/StOq67lcOKQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:XU3LuT5bwyE=:oPva1eHjwj68X7wuD47dF6 pF2kEzoKom312Ga/WZCT/tOkg2HMHNiNo4pt6IFcT/XRQ0pwt1ufsuFwqjuvpm+q5xnmPHrYZ 5VGbiveauePGnxs9OUpqxo81tyGpgJTlz2gvOa5Y/V1XgG9YRZCom/BNRu5pq5fGRlMF+pY6x Gcv+dRCaIsTlNYMmE/ua9Giku/StUmCIT5nVwm+6aXA4fM9jPlWGHsJ5yVYWLRaGSoAgxHnuE pYDZNrKpOf37Qwn+fIVViFjmr9uHM7O0UKSBSwtfrQ74aAtA1whsjzq7iOG4Pkpc+dRAIfK2P IlKIlKx1TS7jYyLm90NuCTN4Gz5SxMxO3SEDhB6eA4c2hEZeXw3xUH2RHywQ4eYDMXJ7rigJi OBGrTdQFUGfhFogcoIdZvDLNLe1PmGjbSiirhHOjV6aJqyjNubgjezlanljAREBkqq8apFTcP ZRu+303xgDdwkziojov1l3Di9m9xKQ5uEdT/1dS2xNmyBBturUTi/xmwDDImo2psYtNxexIhS pl8Opjubh/W/tLZp0HUBVXbqzc+wGEPY/8ftcs7jWrzAuWqVCwrV0jH1w1IQrB6a9E5rRkvKY MF3vi5/0+v1RglZH7YPBhgYEOqdP7UQGtdq9IdzpTsHkmxkCfb4nxMXgjLRiDIINDqxiw+Kqq CuhW/n6OrnjarJQVYki3DMOD5SvfvjaxXXBEJth6FsBgTl1+uyh/5ma8u/Yvrdghy428yhArp ybvHmYsYJ8aouDhiuBsgr69TMceuX9Hj81OOhkmgdI+yIUBnMbAvrEoyLN81CANnQtAml6wB8 5DSfR+ODW5T5O3mi7O0TBPaX5r6CsFJ7OWWOQoXzPk7T59X/UcNXJx+bjcsybvAY75uR1SH3N 2eC6Wk1VhKa4+et+PT8Z+aPZlRngZ8Mb0YVn6ToqYZHyHU/MVVyuyLY9KXddMaFCoZYVVLcsF eVt7DGJByLC4zuMd9gnd75gFEV6qVFCSz1y0NHwnyicy6faRs7uXzDgdqb8UBeqg/wgBDhwcs 5i1/w9DA9WNzfQJ63yeFVHXvj/ZRo645wHZQGjnVGzin5BxsArOv7Tinkv50syZ0SMdj8sHzl X1sVZ4KcDYnlaM7HSKZc5O6BB0TDuA00O/vRWFFDA3OvgBFUi7wJHe69g== 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; }