mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: switch open-coded instances to platform_mem_driver
@ 2023-01-10 17:35 Ahmad Fatoum
  2023-01-11  7:12 ` [PATCH] fixup! " Ahmad Fatoum
  0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2023-01-10 17:35 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Now that platform_mem_driver ensures probe at mem_initcall level, we no
longer need to use the opencoded version.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-imx/esdctl.c      | 13 +------------
 arch/arm/mach-stm32mp/ddrctrl.c | 13 +------------
 2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index eb47957db0e5..9954bcb40bc1 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -754,18 +754,7 @@ static struct driver imx_esdctl_driver = {
 	.id_table = imx_esdctl_ids,
 	.of_compatible = DRV_OF_COMPAT(imx_esdctl_dt_ids),
 };
-
-static int imx_esdctl_init(void)
-{
-	int ret;
-
-	ret = platform_driver_register(&imx_esdctl_driver);
-	if (ret)
-		return ret;
-
-	return of_devices_ensure_probed_by_dev_id(imx_esdctl_dt_ids);
-}
-mem_initcall(imx_esdctl_init);
+platform_mem_driver(imx_esdctl_driver);
 
 /*
  * The i.MX SoCs usually have two SDRAM chipselects. The following
diff --git a/arch/arm/mach-stm32mp/ddrctrl.c b/arch/arm/mach-stm32mp/ddrctrl.c
index ad4662c44d07..ffda1ba61f3c 100644
--- a/arch/arm/mach-stm32mp/ddrctrl.c
+++ b/arch/arm/mach-stm32mp/ddrctrl.c
@@ -157,15 +157,4 @@ static struct driver stm32mp1_ddr_driver = {
 	.probe  = stm32mp1_ddr_probe,
 	.of_compatible = DRV_OF_COMPAT(stm32mp1_ddr_dt_ids),
 };
-
-static int stm32mp1_ddr_init(void)
-{
-	int ret;
-
-	ret = platform_driver_register(&stm32mp1_ddr_driver);
-	if (ret)
-		return ret;
-
-	return of_devices_ensure_probed_by_dev_id(stm32mp1_ddr_dt_ids);
-}
-mem_initcall(stm32mp1_ddr_init);
+mem_platform_driver(stm32mp1_ddr_driver);
-- 
2.30.2




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

end of thread, other threads:[~2023-01-11  7:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10 17:35 [PATCH] ARM: switch open-coded instances to platform_mem_driver Ahmad Fatoum
2023-01-11  7:12 ` [PATCH] fixup! " Ahmad Fatoum
2023-01-11  7:57   ` Sascha Hauer

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