Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH] can: flexcan: Convert the driver to DT-only
@ 2020-11-28 13:28 Fabio Estevam
  2020-11-30 11:49 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2020-11-28 13:28 UTC (permalink / raw)
  To: mkl; +Cc: wg, linux-can, Fabio Estevam

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: Fabio Estevam <festevam@gmail.com>
---
 drivers/net/can/flexcan.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index e85f20d18d67..038fe1036df2 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1940,15 +1940,8 @@ static const struct of_device_id 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)
 {
-	const struct of_device_id *of_id;
 	const struct flexcan_devtype_data *devtype_data;
 	struct net_device *dev;
 	struct flexcan_priv *priv;
@@ -1997,15 +1990,7 @@ static int flexcan_probe(struct platform_device *pdev)
 	if (IS_ERR(regs))
 		return PTR_ERR(regs);
 
-	of_id = of_match_device(flexcan_of_match, &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;
-	}
+	devtype_data = of_device_get_match_data(&pdev->dev);
 
 	if ((devtype_data->quirks & FLEXCAN_QUIRK_SUPPORT_FD) &&
 	    !(devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)) {
@@ -2235,7 +2220,6 @@ static struct platform_driver flexcan_driver = {
 	},
 	.probe = flexcan_probe,
 	.remove = flexcan_remove,
-	.id_table = flexcan_id_table,
 };
 
 module_platform_driver(flexcan_driver);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] can: flexcan: Convert the driver to DT-only
  2020-11-28 13:28 [PATCH] can: flexcan: Convert the driver to DT-only Fabio Estevam
@ 2020-11-30 11:49 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2020-11-30 11:49 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: wg, linux-can


[-- Attachment #1.1: Type: text/plain, Size: 600 bytes --]

On 11/28/20 2:28 PM, Fabio Estevam wrote:
> 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: Fabio Estevam <festevam@gmail.com>

Applied to can-next/testing

Tnx,
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 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-30 11:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-28 13:28 [PATCH] can: flexcan: Convert the driver to DT-only Fabio Estevam
2020-11-30 11:49 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox