mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>, gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/6] serial: xilinx_uartps: drop cdns_uart::cdns_uart_driver
Date: Thu, 20 Nov 2025 08:30:53 +0100	[thread overview]
Message-ID: <aefd886b-381f-42b3-8c58-ff8834158675@amd.com> (raw)
In-Reply-To: <20251119092457.826789-3-jirislaby@kernel.org>



On 11/19/25 10:24, Jiri Slaby (SUSE) wrote:
> Provided the uart driver is available globally, there is no need to
> store a pointer to it in struct cdns_uart. Instead, use the global
> cdns_uart_uart_driver in the code directly.
> 
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> ---
> Cc: Michal Simek <michal.simek@amd.com>
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>   drivers/tty/serial/xilinx_uartps.c | 15 +++++----------
>   1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index a66b44d21fba..c793fc74c26b 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -190,7 +190,6 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");
>    * @port:		Pointer to the UART port
>    * @uartclk:		Reference clock
>    * @pclk:		APB clock
> - * @cdns_uart_driver:	Pointer to UART driver
>    * @baud:		Current baud rate
>    * @clk_rate_change_nb:	Notifier block for clock changes
>    * @quirks:		Flags for RXBS support.
> @@ -204,7 +203,6 @@ struct cdns_uart {
>   	struct uart_port	*port;
>   	struct clk		*uartclk;
>   	struct clk		*pclk;
> -	struct uart_driver	*cdns_uart_driver;
>   	unsigned int		baud;
>   	struct notifier_block	clk_rate_change_nb;
>   	u32			quirks;
> @@ -1465,7 +1463,6 @@ static struct console cdns_uart_console = {
>   static int cdns_uart_suspend(struct device *device)
>   {
>   	struct uart_port *port = dev_get_drvdata(device);
> -	struct cdns_uart *cdns_uart = port->private_data;
>   	int may_wake;
>   
>   	may_wake = device_may_wakeup(device);
> @@ -1489,7 +1486,7 @@ static int cdns_uart_suspend(struct device *device)
>   	 * Call the API provided in serial_core.c file which handles
>   	 * the suspend.
>   	 */
> -	return uart_suspend_port(cdns_uart->cdns_uart_driver, port);
> +	return uart_suspend_port(&cdns_uart_uart_driver, port);
>   }
>   
>   /**
> @@ -1550,7 +1547,7 @@ static int cdns_uart_resume(struct device *device)
>   		uart_port_unlock_irqrestore(port, flags);
>   	}
>   
> -	return uart_resume_port(cdns_uart->cdns_uart_driver, port);
> +	return uart_resume_port(&cdns_uart_uart_driver, port);
>   }
>   #endif /* ! CONFIG_PM_SLEEP */
>   static int __maybe_unused cdns_runtime_suspend(struct device *dev)
> @@ -1686,8 +1683,6 @@ static int cdns_uart_probe(struct platform_device *pdev)
>   		}
>   	}
>   
> -	cdns_uart_data->cdns_uart_driver = &cdns_uart_uart_driver;
> -
>   	match = of_match_node(cdns_uart_of_match, pdev->dev.of_node);
>   	if (match && match->data) {
>   		const struct cdns_platform_data *data = match->data;
> @@ -1862,7 +1857,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
>   	clk_disable_unprepare(cdns_uart_data->pclk);
>   err_out_unregister_driver:
>   	if (!instances)
> -		uart_unregister_driver(cdns_uart_data->cdns_uart_driver);
> +		uart_unregister_driver(&cdns_uart_uart_driver);
>   	return rc;
>   }
>   
> @@ -1880,7 +1875,7 @@ static void cdns_uart_remove(struct platform_device *pdev)
>   	clk_notifier_unregister(cdns_uart_data->uartclk,
>   			&cdns_uart_data->clk_rate_change_nb);
>   #endif
> -	uart_remove_one_port(cdns_uart_data->cdns_uart_driver, port);
> +	uart_remove_one_port(&cdns_uart_uart_driver, port);
>   	port->mapbase = 0;
>   	clk_disable_unprepare(cdns_uart_data->uartclk);
>   	clk_disable_unprepare(cdns_uart_data->pclk);
> @@ -1896,7 +1891,7 @@ static void cdns_uart_remove(struct platform_device *pdev)
>   	reset_control_assert(cdns_uart_data->rstc);
>   
>   	if (!--instances)
> -		uart_unregister_driver(cdns_uart_data->cdns_uart_driver);
> +		uart_unregister_driver(&cdns_uart_uart_driver);
>   }
>   
>   static struct platform_driver cdns_uart_platform_driver = {

Acked-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

  reply	other threads:[~2025-11-20  7:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19  9:24 [PATCH 0/6] tty cleanup for 6.19 or later Jiri Slaby (SUSE)
2025-11-19  9:24 ` [PATCH 1/6] tty: vt: do not open code DIV_ROUND_UP() Jiri Slaby (SUSE)
2025-11-19  9:24 ` [PATCH 2/6] serial: xilinx_uartps: drop cdns_uart::cdns_uart_driver Jiri Slaby (SUSE)
2025-11-20  7:30   ` Michal Simek [this message]
2025-11-19  9:24 ` [PATCH 3/6] serial: drop SERIAL_8250_DEPRECATED_OPTIONS Jiri Slaby (SUSE)
2025-11-19  9:24 ` [PATCH 4/6] serial: 8250: move skip_txen_test to core Jiri Slaby (SUSE)
2025-11-19  9:24 ` [PATCH 5/6] serial: 8250: make share_irqs local to 8250_platform Jiri Slaby (SUSE)
2025-11-19  9:24 ` [PATCH 6/6] serial: 8250_platform: simplify IRQF_SHARED handling Jiri Slaby (SUSE)

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=aefd886b-381f-42b3-8c58-ff8834158675@amd.com \
    --to=michal.simek@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®