Skip to content

Commit

Permalink
can: sja1000: Use device_get_match_data to get device data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Biju Das authored and Marc Kleine-Budde committed Jul 19, 2022
1 parent 2d99bfb commit 63ab1b6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/can/sja1000/sja1000_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 63ab1b6

Please sign in to comment.