diff options
author | Biju Das <biju.das.jz@bp.renesas.com> | 2022-07-10 13:52:46 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2022-07-19 20:46:59 +0200 |
commit | 63ab1b63695e65fe8cce32afc5319f121f0320f1 (patch) | |
tree | a51baf92ff8d465db4258b9cc61e88c1f8f42978 /drivers/net/can/sja1000 | |
parent | can: sja1000: Add Quirk for RZ/N1 SJA1000 CAN controller (diff) | |
download | linux-63ab1b63695e65fe8cce32afc5319f121f0320f1.tar.xz linux-63ab1b63695e65fe8cce32afc5319f121f0320f1.zip |
can: sja1000: Use device_get_match_data to get device data
This patch replaces of_match_device->device_get_match_data
to get pointer to device data.
Link: https://lore.kernel.org/all/20220710115248.190280-5-biju.das.jz@bp.renesas.com
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/sja1000')
-rw-r--r-- | drivers/net/can/sja1000/sja1000_platform.c | 7 |
1 files 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..0b78568f5286 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 = device_get_match_data(&pdev->dev); + if (of_data) priv_sz = of_data->priv_sz; - } dev = alloc_sja1000dev(priv_sz); if (!dev) |