All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: macb: allow deffered probe of the driver
@ 2015-01-22 17:31 Nicolae Rosia
  2015-01-26 14:37 ` Nicolas Ferre
  2015-01-27  1:10 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolae Rosia @ 2015-01-22 17:31 UTC (permalink / raw)
  To: netdev, nicolas.ferre

The driver is trying to acquire clocks which maybe
are not available yet. Allow the driver to request
deffered probe by providing a probe function and
registering it with module_platform_driver. [1]
This patch is based on 3.19-rc5.

[1] https://lkml.org/lkml/2013/9/23/118

Signed-off-by: Nicolae Rosia <nicolae.rosia@certsign.ro>
---
 drivers/net/ethernet/cadence/macb.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c
b/drivers/net/ethernet/cadence/macb.c
index 3767271..4dfcd66 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -2148,7 +2148,7 @@ static void macb_probe_queues(void __iomem *mem,
 			(*num_queues)++;
 }
 
-static int __init macb_probe(struct platform_device *pdev)
+static int macb_probe(struct platform_device *pdev)
 {
 	struct macb_platform_data *pdata;
 	struct resource *regs;
@@ -2386,7 +2386,7 @@ err_out:
 	return err;
 }
 
-static int __exit macb_remove(struct platform_device *pdev)
+static int macb_remove(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct macb *bp;
@@ -2449,7 +2449,8 @@ static int macb_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(macb_pm_ops, macb_suspend, macb_resume);
 
 static struct platform_driver macb_driver = {
-	.remove		= __exit_p(macb_remove),
+	.probe		= macb_probe,
+	.remove		= macb_remove,
 	.driver		= {
 		.name		= "macb",
 		.of_match_table	= of_match_ptr(macb_dt_ids),
@@ -2457,7 +2458,7 @@ static struct platform_driver macb_driver = {
 	},
 };
 
-module_platform_driver_probe(macb_driver, macb_probe);
+module_platform_driver(macb_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Cadence MACB/GEM Ethernet driver");
-- 
2.1.0


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

* Re: [PATCH] net: macb: allow deffered probe of the driver
  2015-01-22 17:31 [PATCH] net: macb: allow deffered probe of the driver Nicolae Rosia
@ 2015-01-26 14:37 ` Nicolas Ferre
  2015-01-26 15:21   ` Nicolae Rosia
  2015-01-27  1:10 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Nicolas Ferre @ 2015-01-26 14:37 UTC (permalink / raw)
  To: Nicolae Rosia, netdev

Le 22/01/2015 18:31, Nicolae Rosia a écrit :
> The driver is trying to acquire clocks which maybe
> are not available yet. Allow the driver to request
> deffered probe by providing a probe function and
> registering it with module_platform_driver. [1]
> This patch is based on 3.19-rc5.

Do you have a use case for this need?

> [1] https://lkml.org/lkml/2013/9/23/118
> 
> Signed-off-by: Nicolae Rosia <nicolae.rosia@certsign.ro>

But anyway, it's not harmful:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>  drivers/net/ethernet/cadence/macb.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb.c
> b/drivers/net/ethernet/cadence/macb.c
> index 3767271..4dfcd66 100644
> --- a/drivers/net/ethernet/cadence/macb.c
> +++ b/drivers/net/ethernet/cadence/macb.c
> @@ -2148,7 +2148,7 @@ static void macb_probe_queues(void __iomem *mem,
>  			(*num_queues)++;
>  }
>  
> -static int __init macb_probe(struct platform_device *pdev)
> +static int macb_probe(struct platform_device *pdev)
>  {
>  	struct macb_platform_data *pdata;
>  	struct resource *regs;
> @@ -2386,7 +2386,7 @@ err_out:
>  	return err;
>  }
>  
> -static int __exit macb_remove(struct platform_device *pdev)
> +static int macb_remove(struct platform_device *pdev)
>  {
>  	struct net_device *dev;
>  	struct macb *bp;
> @@ -2449,7 +2449,8 @@ static int macb_resume(struct device *dev)
>  static SIMPLE_DEV_PM_OPS(macb_pm_ops, macb_suspend, macb_resume);
>  
>  static struct platform_driver macb_driver = {
> -	.remove		= __exit_p(macb_remove),
> +	.probe		= macb_probe,
> +	.remove		= macb_remove,
>  	.driver		= {
>  		.name		= "macb",
>  		.of_match_table	= of_match_ptr(macb_dt_ids),
> @@ -2457,7 +2458,7 @@ static struct platform_driver macb_driver = {
>  	},
>  };
>  
> -module_platform_driver_probe(macb_driver, macb_probe);
> +module_platform_driver(macb_driver);
>  
>  MODULE_LICENSE("GPL");
>  MODULE_DESCRIPTION("Cadence MACB/GEM Ethernet driver");
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] net: macb: allow deffered probe of the driver
  2015-01-26 14:37 ` Nicolas Ferre
@ 2015-01-26 15:21   ` Nicolae Rosia
  2015-01-26 16:08     ` Nicolas Ferre
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolae Rosia @ 2015-01-26 15:21 UTC (permalink / raw)
  To: nicolas.ferre; +Cc: netdev, michal.simek

On Mon, 2015-01-26 at 15:37 +0100, Nicolas Ferre wrote:
> Do you have a use case for this need?
On my setup (Zynq Platform), the required clocks are
provided by a module which is loaded after this driver,
hence, the clock is not available at initialization time.
> But anyway, it's not harmful:
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Thank you.

Best regards,
Nicolae Rosia

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

* Re: [PATCH] net: macb: allow deffered probe of the driver
  2015-01-26 15:21   ` Nicolae Rosia
@ 2015-01-26 16:08     ` Nicolas Ferre
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Ferre @ 2015-01-26 16:08 UTC (permalink / raw)
  To: Nicolae Rosia, Boris BREZILLON; +Cc: netdev, michal.simek

Le 26/01/2015 16:21, Nicolae Rosia a écrit :
> On Mon, 2015-01-26 at 15:37 +0100, Nicolas Ferre wrote:
>> Do you have a use case for this need?
> On my setup (Zynq Platform), the required clocks are
> provided by a module which is loaded after this driver,
> hence, the clock is not available at initialization time.

That's what I (actually Boris who I've consulted regarding this) felt.
Thanks for having confirmed this.

>> But anyway, it's not harmful:
>> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Thank you.
> 
> Best regards,
> Nicolae Rosia
> 

Bye,
-- 
Nicolas Ferre

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

* Re: [PATCH] net: macb: allow deffered probe of the driver
  2015-01-22 17:31 [PATCH] net: macb: allow deffered probe of the driver Nicolae Rosia
  2015-01-26 14:37 ` Nicolas Ferre
@ 2015-01-27  1:10 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2015-01-27  1:10 UTC (permalink / raw)
  To: nicolae.rosia; +Cc: netdev, nicolas.ferre

From: Nicolae Rosia <nicolae.rosia@certsign.ro>
Date: Thu, 22 Jan 2015 17:31:05 +0000

> The driver is trying to acquire clocks which maybe
> are not available yet. Allow the driver to request
> deffered probe by providing a probe function and
> registering it with module_platform_driver. [1]
> This patch is based on 3.19-rc5.
> 
> [1] https://lkml.org/lkml/2013/9/23/118
> 
> Signed-off-by: Nicolae Rosia <nicolae.rosia@certsign.ro>

Applied.

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

end of thread, other threads:[~2015-01-27  1:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22 17:31 [PATCH] net: macb: allow deffered probe of the driver Nicolae Rosia
2015-01-26 14:37 ` Nicolas Ferre
2015-01-26 15:21   ` Nicolae Rosia
2015-01-26 16:08     ` Nicolas Ferre
2015-01-27  1:10 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.