Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bramwel Barack" <bramwelbarack89@gmail.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH] tty: serial: mvebu-uart: use device_get_match_data()
Date: Mon, 26 Oct 2026 09:11:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-184743@kernel.org> (raw)
In-Reply-To: <20261026074644.17464-1-bramwelbarack89@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] tty: serial: mvebu-uart: unused mvebu_uart_of_match when !CONFIG_OF
--

commit 0c58839f587a9fd9238f4c8d5f0c179c6753ed36
Author: Bramwel Barack <bramwelbarack89@gmail.com>

tty: serial: mvebu-uart: use device_get_match_data()

This commit replaces the of_match_device() call in mvebu_uart_probe() with
device_get_match_data() and removes the <linux/of_device.h> and
<linux/of_platform.h> header includes.

> diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
> index 33ea496c93b29..adc2cf7ee65d1 100644
> --- a/drivers/tty/serial/mvebu-uart.c
> +++ b/drivers/tty/serial/mvebu-uart.c

[ ... ]

> @@ -866,8 +864,6 @@ static int uart_num_counter;
>  
>  static int mvebu_uart_probe(struct platform_device *pdev)
>  {
> -	const struct of_device_id *match = of_match_device(mvebu_uart_of_match,
> -							   &pdev->dev);
>  	struct uart_port *port;
>  	struct mvebu_uart *mvuart;
>  	struct resource *reg;
> @@ -919,7 +915,7 @@ static int mvebu_uart_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	/* Get controller data depending on the compatible string */
> -	mvuart->data = (struct mvebu_uart_driver_data *)match->data;
> +	mvuart->data = (struct mvebu_uart_driver_data *)device_get_match_data(&pdev->dev);

[Severity: Low]
Does removing of_match_device(mvebu_uart_of_match, &pdev->dev) in
mvebu_uart_probe() leave mvebu_uart_of_match unused when building with
compile test enabled and devicetree disabled?

Previously, passing mvebu_uart_of_match to the static inline stub
of_match_device() kept the table referenced when devicetree support was
disabled. Now the only remaining reference in mvebu_uart_platform_driver
is wrapped in of_match_ptr():

drivers/tty/serial/mvebu-uart.c:
    static const struct of_device_id mvebu_uart_of_match[] = {
        ...
    };

    static struct platform_driver mvebu_uart_platform_driver = {
        .probe	= mvebu_uart_probe,
        .driver	= {
            .name  = "mvebu-uart",
            .of_match_table = of_match_ptr(mvebu_uart_of_match),

When devicetree is disabled, of_match_ptr(mvebu_uart_of_match) expands to
null, causing an unused const variable warning on mvebu_uart_of_match. In
addition, the forward declaration above mvebu_uart_probe() is no longer
needed:

drivers/tty/serial/mvebu-uart.c:
    static const struct of_device_id mvebu_uart_of_match[];

Should the forward declaration of mvebu_uart_of_match be removed and
of_match_ptr() dropped from mvebu_uart_platform_driver (or __maybe_unused
added to mvebu_uart_of_match)?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261026074644.17464-1-bramwelbarack89@gmail.com?part=1

      reply	other threads:[~2026-10-26  9:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26  7:46 [PATCH] tty: serial: mvebu-uart: use device_get_match_data() Bramwel Barack
2026-10-26  9:11 ` sashiko-bot [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=sashiko-outbox-184743@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bramwelbarack89@gmail.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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