[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220702161836.zuixkwjbbo5li7o5@pengutronix.de>
Date: Sat, 2 Jul 2022 18:18:36 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Biju Das <biju.das.jz@...renesas.com>
Cc: Wolfgang Grandegger <wg@...ndegger.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, linux-can@...r.kernel.org,
netdev@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>,
Chris Paterson <Chris.Paterson2@...esas.com>,
Biju Das <biju.das@...renesas.com>,
linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH 4/6] can: sja1000: Use of_device_get_match_data to get
device data
On 02.07.2022 15:01:28, Biju Das wrote:
> This patch replaces of_match_device->of_device_get_match_data
> to get pointer to device data.
>
> Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
> ---
> drivers/net/can/sja1000/sja1000_platform.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c
> index f9ec7bd8dfac..24ea0f76e130 100644
> --- a/drivers/net/can/sja1000/sja1000_platform.c
> +++ b/drivers/net/can/sja1000/sja1000_platform.c
> @@ -210,7 +210,6 @@ static int sp_probe(struct platform_device *pdev)
> struct resource *res_mem, *res_irq = NULL;
> struct sja1000_platform_data *pdata;
> struct device_node *of = pdev->dev.of_node;
> - const struct of_device_id *of_id;
> const struct sja1000_of_data *of_data = NULL;
> size_t priv_sz = 0;
>
> @@ -243,11 +242,9 @@ static int sp_probe(struct platform_device *pdev)
> return -ENODEV;
> }
>
> - of_id = of_match_device(sp_of_table, &pdev->dev);
> - if (of_id && of_id->data) {
> - of_data = of_id->data;
> + of_data = of_device_get_match_data(&pdev->dev);
Can you use device_get_match_data() instead?
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists