From patchwork Sun Jul 3 17:00:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12904418 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D12B7C43334 for ; Sun, 3 Jul 2022 17:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=St3alUPDYe3hTb36tM0z9A1NlAgGVZRoCPvqysBqiF0=; b=b///hBXkfI8OjB QJODcD4hGCS2Aev7pNxwHeA5g7yluzyLAqbIbRFhda8f+STe56cqykYPdC7DUgfhVt8kVFta1nHiD qI1sVmPFJfHyT60fBSXP/VWZ/W1kYNVgGRsL/pmJuT4BV1RO1AIPf0qGM0DUAgjHMHH2GwItz4Hs6 qUwW5q9UzCbIk+4104vx7aJm8FABAApr/1J0iWxg12uu1AEVHdTd+pAKZEu56vn4UH8rXY6I+2EWH zL5sTttx4aBRPh/YLIWiJJDfNxGKqxYZaHbmHpnZgjiSc+pyyjq4ZqJSqhsHPD79X/46HI5ozfMT7 6c/3pqsnVpa6ywF6520A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8302-00HNGS-WA; Sun, 03 Jul 2022 17:03:11 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o82yj-00HMVj-NW for linux-arm-kernel@lists.infradead.org; Sun, 03 Jul 2022 17:01:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656867693; bh=nviYHbsk7MUrNRrU2LChICEnd9k2yAJfBhTih4EkRFU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=bfdg9Q49+9fanC418tQVocQrYkJukV2m2YyGouT3Gtfn9930Ay67FU8PMbEX2Ncvo VASUlpgLNTfF+bQC6ikmKXX10KopUCt0Dpfe42ofDYkYRLW9G3C++1NiUUo0TRFi04 4LUemO34zsS9GxuSSISO8GiX5ZjkuAinkZmPgM7o= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.210]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtfNl-1nKbyt39up-00v91q; Sun, 03 Jul 2022 19:01:32 +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 v2 7/9] serial: ar933x: Fix check for RS485 support Date: Sun, 3 Jul 2022 19:00:37 +0200 Message-Id: <20220703170039.2058202-8-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> References: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 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XlelEB2yf8Sz1kn5SiPn g8OvF0Hosp3M+9ZfW5qs5Y5kVmjWq/WQFKZLcrG5ZVDYzz/KnS3o9N3c9mYU4xDeAI/NpLAYo RZ5A4n8I5sXCxWZGNP2VdzpS1Va8Qz/Q0l4yifOV3jsrj8sY6WQg0VFLTeYInQ9YyqiuWpcZv gcPEDVJllns4/zpaeayYvNIJ9YzMN/e749djGIpm7wCZotQefi2xB2c7gdfFKSWm/hB106m4q Mn/gw9P4T/zl6OMY91B84wkxb0zX65tAhnLV5VMXNCNQkbbRKzxJsVzbBIeQXD3TJihR5aap/ Qh7ZIf3nhmME+JwVeyDt/XxwVbZOwJ1VCI0JXFtqeKYo4JnbSzuUnF+Mw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220703_100150_124908_9A37DD1A X-CRM114-Status: GOOD ( 13.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Lino Sanfilippo Without an RTS GPIO RS485 is not possible so disable the support regardless of whether RS485 is enabled at boottime or not. Also remove the now superfluous check for the RTS GPIO in ar933x_config_rs485(). Fixes: e849145e1fdd ("serial: ar933x: Fill in rs485_supported") Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/ar933x_uart.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index b73ce13683db..dac48a330db6 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -583,14 +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; } @@ -798,11 +790,12 @@ static int ar933x_uart_probe(struct platform_device *pdev) up->rts_gpiod = mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS); - if ((port->rs485.flags & SER_RS485_ENABLED) && - !up->rts_gpiod) { - dev_err(&pdev->dev, "lacking rts-gpio, disabling RS485\n"); - port->rs485.flags &= ~SER_RS485_ENABLED; + if (!up->rts_gpiod) { port->rs485_supported = &ar933x_no_rs485; + if (port->rs485.flags & SER_RS485_ENABLED) { + dev_err(&pdev->dev, "lacking rts-gpio, disabling RS485\n"); + port->rs485.flags &= ~SER_RS485_ENABLED; + } } #ifdef CONFIG_SERIAL_AR933X_CONSOLE