linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bus: imx-weim: module_platform_driver()
@ 2019-08-14  8:23 Sascha Hauer
  2019-08-19 12:08 ` Shawn Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2019-08-14  8:23 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sascha Hauer, Shawn Guo, NXP Linux Team, Pengutronix Kernel Team

Switch from module_platform_driver_probe() to module_platform_driver().
The former is not suitable for booting with device tree as the driver
will be registered before the device and thus won't be probed again
when the device is present.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/bus/imx-weim.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
index db74334ca5ef..8a9f8a4328c2 100644
--- a/drivers/bus/imx-weim.c
+++ b/drivers/bus/imx-weim.c
@@ -183,8 +183,7 @@ static int __init weim_timing_setup(struct device *dev,
 	return 0;
 }
 
-static int __init weim_parse_dt(struct platform_device *pdev,
-				void __iomem *base)
+static int weim_parse_dt(struct platform_device *pdev, void __iomem *base)
 {
 	const struct of_device_id *of_id = of_match_device(weim_id_table,
 							   &pdev->dev);
@@ -217,7 +216,7 @@ static int __init weim_parse_dt(struct platform_device *pdev,
 	return ret;
 }
 
-static int __init weim_probe(struct platform_device *pdev)
+static int weim_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct clk *clk;
@@ -254,8 +253,9 @@ static struct platform_driver weim_driver = {
 		.name		= "imx-weim",
 		.of_match_table	= weim_id_table,
 	},
+	.probe = weim_probe,
 };
-module_platform_driver_probe(weim_driver, weim_probe);
+module_platform_driver(weim_driver);
 
 MODULE_AUTHOR("Freescale Semiconductor Inc.");
 MODULE_DESCRIPTION("i.MX EIM Controller Driver");
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] bus: imx-weim: module_platform_driver()
  2019-08-14  8:23 [PATCH] bus: imx-weim: module_platform_driver() Sascha Hauer
@ 2019-08-19 12:08 ` Shawn Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2019-08-19 12:08 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Pengutronix Kernel Team, linux-arm-kernel, NXP Linux Team

On Wed, Aug 14, 2019 at 10:23:16AM +0200, Sascha Hauer wrote:
> Switch from module_platform_driver_probe() to module_platform_driver().
> The former is not suitable for booting with device tree as the driver
> will be registered before the device and thus won't be probed again
> when the device is present.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Applied with subject updated like below.

  bus: imx-weim: use module_platform_driver()

Shawn

> ---
>  drivers/bus/imx-weim.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
> index db74334ca5ef..8a9f8a4328c2 100644
> --- a/drivers/bus/imx-weim.c
> +++ b/drivers/bus/imx-weim.c
> @@ -183,8 +183,7 @@ static int __init weim_timing_setup(struct device *dev,
>  	return 0;
>  }
>  
> -static int __init weim_parse_dt(struct platform_device *pdev,
> -				void __iomem *base)
> +static int weim_parse_dt(struct platform_device *pdev, void __iomem *base)
>  {
>  	const struct of_device_id *of_id = of_match_device(weim_id_table,
>  							   &pdev->dev);
> @@ -217,7 +216,7 @@ static int __init weim_parse_dt(struct platform_device *pdev,
>  	return ret;
>  }
>  
> -static int __init weim_probe(struct platform_device *pdev)
> +static int weim_probe(struct platform_device *pdev)
>  {
>  	struct resource *res;
>  	struct clk *clk;
> @@ -254,8 +253,9 @@ static struct platform_driver weim_driver = {
>  		.name		= "imx-weim",
>  		.of_match_table	= weim_id_table,
>  	},
> +	.probe = weim_probe,
>  };
> -module_platform_driver_probe(weim_driver, weim_probe);
> +module_platform_driver(weim_driver);
>  
>  MODULE_AUTHOR("Freescale Semiconductor Inc.");
>  MODULE_DESCRIPTION("i.MX EIM Controller Driver");
> -- 
> 2.20.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-08-19 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14  8:23 [PATCH] bus: imx-weim: module_platform_driver() Sascha Hauer
2019-08-19 12:08 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).