Linux-Serial Archive mirror
 help / color / mirror / Atom feed
From: Lino Sanfilippo <l.sanfilippo@kunbus.com>
To: gregkh@linuxfoundation.org, jirislaby@kernel.org
Cc: LinoSanfilippo@gmx.de, lukas@wunner.de, p.rosenberger@kunbus.com,
	ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org,
	Lino Sanfilippo <l.sanfilippo@kunbus.com>
Subject: [PATCH 4/4] serial: ar933x: Remove unneeded static structure
Date: Sun,  7 Apr 2024 02:27:09 +0200	[thread overview]
Message-ID: <20240407002709.16224-5-l.sanfilippo@kunbus.com> (raw)
In-Reply-To: <20240407002709.16224-1-l.sanfilippo@kunbus.com>

In case that no RTS GPIO is available do not use a dedicated nullified
serial_rs485 struct to disable RS485 support, but simply delete the
SER_RS485_ENABLED flag in the ports rs485_supported struct.
This make the structure superfluous and it can be removed.

Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
---
 drivers/tty/serial/ar933x_uart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
index 8d09ace062e5..be9ea988d136 100644
--- a/drivers/tty/serial/ar933x_uart.c
+++ b/drivers/tty/serial/ar933x_uart.c
@@ -699,7 +699,6 @@ static struct uart_driver ar933x_uart_driver = {
 	.cons		= NULL, /* filled in runtime */
 };
 
-static const struct serial_rs485 ar933x_no_rs485 = {};
 static const struct serial_rs485 ar933x_rs485_supported = {
 	.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND,
 };
@@ -795,7 +794,7 @@ static int ar933x_uart_probe(struct platform_device *pdev)
 	up->rts_gpiod = mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS);
 
 	if (!up->rts_gpiod) {
-		port->rs485_supported = ar933x_no_rs485;
+		port->rs485_supported.flags &= ~SER_RS485_ENABLED;
 		if (port->rs485.flags & SER_RS485_ENABLED) {
 			dev_err(&pdev->dev, "lacking rts-gpio, disabling RS485\n");
 			port->rs485.flags &= ~SER_RS485_ENABLED;
-- 
2.43.2


      parent reply	other threads:[~2024-04-07  0:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07  0:27 [PATCH 0/4] RS485 cleanups Lino Sanfilippo
2024-04-07  0:27 ` [PATCH 1/4] serial: amba-pl011: get rid of useless wrapper pl011_get_rs485_mode() Lino Sanfilippo
2024-04-07  0:27 ` [PATCH 2/4] serial: amba-pl011: move variable into CONFIG_DMA_ENGINE conditional Lino Sanfilippo
2024-04-07  0:27 ` [PATCH 3/4] serial: 8250: Remove superfluous sanity check Lino Sanfilippo
2024-04-07  0:27 ` Lino Sanfilippo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240407002709.16224-5-l.sanfilippo@kunbus.com \
    --to=l.sanfilippo@kunbus.com \
    --cc=LinoSanfilippo@gmx.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=p.rosenberger@kunbus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).