mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Tang Bin <tangbin@cmss.chinamobile.com>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
	ldewangan@nvidia.com, thierry.reding@gmail.com,
	jonathanh@nvidia.com, linux@prisktech.co.nz,
	linux-mips@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Subject: Re: [PATCH 1/3] serial: 8250_ingenic: Use of_device_get_match_data
Date: Sun, 22 Aug 2021 12:16:29 +0100	[thread overview]
Message-ID: <HBN8YQ.GODLCGECPCT01@crapouillou.net> (raw)
In-Reply-To: <20210822032806.3256-2-tangbin@cmss.chinamobile.com>

Hi,

Le dim., août 22 2021 at 11:28:04 +0800, Tang Bin 
<tangbin@cmss.chinamobile.com> a écrit :
> Retrieve OF match data, it's better and cleaner to use
> 'of_device_get_match_data' over 'of_match_device'.
> 
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>

Acked-by: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> ---
>  drivers/tty/serial/8250/8250_ingenic.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_ingenic.c 
> b/drivers/tty/serial/8250/8250_ingenic.c
> index 988bf6bcc..65402d05e 100644
> --- a/drivers/tty/serial/8250/8250_ingenic.c
> +++ b/drivers/tty/serial/8250/8250_ingenic.c
> @@ -209,16 +209,14 @@ static int ingenic_uart_probe(struct 
> platform_device *pdev)
>  	struct uart_8250_port uart = {};
>  	struct ingenic_uart_data *data;
>  	const struct ingenic_uart_config *cdata;
> -	const struct of_device_id *match;
>  	struct resource *regs;
>  	int irq, err, line;
> 
> -	match = of_match_device(of_match, &pdev->dev);
> -	if (!match) {
> +	cdata = of_device_get_match_data(&pdev->dev);
> +	if (!cdata) {
>  		dev_err(&pdev->dev, "Error: No device match found\n");
>  		return -ENODEV;
>  	}
> -	cdata = match->data;
> 
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)
> --
> 2.20.1.windows.1
> 
> 
> 



  reply	other threads:[~2021-08-22 11:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22  3:28 [PATCH 0/3] serial: " Tang Bin
2021-08-22  3:28 ` [PATCH 1/3] serial: 8250_ingenic: " Tang Bin
2021-08-22 11:16   ` Paul Cercueil [this message]
2021-08-22  3:28 ` [PATCH 2/3] serial: tegra: " Tang Bin
2021-08-22  3:28 ` [PATCH 3/3] serial: vt8500: " Tang Bin

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=HBN8YQ.GODLCGECPCT01@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@prisktech.co.nz \
    --cc=tangbin@cmss.chinamobile.com \
    --cc=thierry.reding@gmail.com \
    --cc=zhangshengju@cmss.chinamobile.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

all inboxes | Powered by JetHome®