mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2] ARM: switch open-coded instances to platform_mem_driver
@ 2023-01-11  8:03 Ahmad Fatoum
  2023-01-11  8:21 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-01-11  8:03 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>
---
v1 -> v2:
  - squash fixup correcting typo (Sascha)
---
 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..a704250297bb 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);
+mem_platform_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] 2+ messages in thread

* Re: [PATCH v2] ARM: switch open-coded instances to platform_mem_driver
  2023-01-11  8:03 [PATCH v2] ARM: switch open-coded instances to platform_mem_driver Ahmad Fatoum
@ 2023-01-11  8:21 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-01-11  8:21 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Wed, Jan 11, 2023 at 09:03:04AM +0100, Ahmad Fatoum wrote:
> 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>
> ---
> v1 -> v2:
>   - squash fixup correcting typo (Sascha)
> ---
>  arch/arm/mach-imx/esdctl.c      | 13 +------------
>  arch/arm/mach-stm32mp/ddrctrl.c | 13 +------------
>  2 files changed, 2 insertions(+), 24 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
> index eb47957db0e5..a704250297bb 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);
> +mem_platform_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
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11  8:03 [PATCH v2] ARM: switch open-coded instances to platform_mem_driver Ahmad Fatoum
2023-01-11  8:21 ` Sascha Hauer

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