Commit 2c0ac920 authored by Fabio Estevam's avatar Fabio Estevam Committed by Marc Kleine-Budde

can: flexcan: convert the driver to DT-only

The flexcan driver runs only on DT platforms, so simplify the code by using
of_device_get_match_data() to retrieve the driver data and also by removing the
unused id_table.
Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20201128132855.7724-1-festevam@gmail.comSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent cab7ffc0
...@@ -1940,15 +1940,8 @@ static const struct of_device_id flexcan_of_match[] = { ...@@ -1940,15 +1940,8 @@ static const struct of_device_id flexcan_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, flexcan_of_match); MODULE_DEVICE_TABLE(of, flexcan_of_match);
static const struct platform_device_id flexcan_id_table[] = {
{ .name = "flexcan", .driver_data = (kernel_ulong_t)&fsl_p1010_devtype_data, },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(platform, flexcan_id_table);
static int flexcan_probe(struct platform_device *pdev) static int flexcan_probe(struct platform_device *pdev)
{ {
const struct of_device_id *of_id;
const struct flexcan_devtype_data *devtype_data; const struct flexcan_devtype_data *devtype_data;
struct net_device *dev; struct net_device *dev;
struct flexcan_priv *priv; struct flexcan_priv *priv;
...@@ -1997,15 +1990,7 @@ static int flexcan_probe(struct platform_device *pdev) ...@@ -1997,15 +1990,7 @@ static int flexcan_probe(struct platform_device *pdev)
if (IS_ERR(regs)) if (IS_ERR(regs))
return PTR_ERR(regs); return PTR_ERR(regs);
of_id = of_match_device(flexcan_of_match, &pdev->dev); devtype_data = of_device_get_match_data(&pdev->dev);
if (of_id) {
devtype_data = of_id->data;
} else if (platform_get_device_id(pdev)->driver_data) {
devtype_data = (struct flexcan_devtype_data *)
platform_get_device_id(pdev)->driver_data;
} else {
return -ENODEV;
}
if ((devtype_data->quirks & FLEXCAN_QUIRK_SUPPORT_FD) && if ((devtype_data->quirks & FLEXCAN_QUIRK_SUPPORT_FD) &&
!(devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)) { !(devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)) {
...@@ -2235,7 +2220,6 @@ static struct platform_driver flexcan_driver = { ...@@ -2235,7 +2220,6 @@ static struct platform_driver flexcan_driver = {
}, },
.probe = flexcan_probe, .probe = flexcan_probe,
.remove = flexcan_remove, .remove = flexcan_remove,
.id_table = flexcan_id_table,
}; };
module_platform_driver(flexcan_driver); module_platform_driver(flexcan_driver);
......
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