Commit 63ab1b63 authored by Biju Das's avatar Biju Das Committed by Marc Kleine-Budde

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.comSigned-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 2d99bfbf
...@@ -210,7 +210,6 @@ static int sp_probe(struct platform_device *pdev) ...@@ -210,7 +210,6 @@ static int sp_probe(struct platform_device *pdev)
struct resource *res_mem, *res_irq = NULL; struct resource *res_mem, *res_irq = NULL;
struct sja1000_platform_data *pdata; struct sja1000_platform_data *pdata;
struct device_node *of = pdev->dev.of_node; struct device_node *of = pdev->dev.of_node;
const struct of_device_id *of_id;
const struct sja1000_of_data *of_data = NULL; const struct sja1000_of_data *of_data = NULL;
size_t priv_sz = 0; size_t priv_sz = 0;
...@@ -243,11 +242,9 @@ static int sp_probe(struct platform_device *pdev) ...@@ -243,11 +242,9 @@ static int sp_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
of_id = of_match_device(sp_of_table, &pdev->dev); of_data = device_get_match_data(&pdev->dev);
if (of_id && of_id->data) { if (of_data)
of_data = of_id->data;
priv_sz = of_data->priv_sz; priv_sz = of_data->priv_sz;
}
dev = alloc_sja1000dev(priv_sz); dev = alloc_sja1000dev(priv_sz);
if (!dev) if (!dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment