netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/8] smc91x: add SMC91X_NOWAIT flag to platform data
@ 2008-06-19 11:06 Eric Miao
  2008-06-19 16:06 ` Nicolas Pitre
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Miao @ 2008-06-19 11:06 UTC (permalink / raw)
  To: linux-netdev, linux-arm-kernel; +Cc: Nicolas Pitre, Magnus Damm


And also favors the usage of SMC91X_NOWAIT over the hardcoded SMC_NOWAIT
by converting "nowait" (module parameter overridable) to platform flag.

There are several possibilities:

  1. platform data present - preferred and use as is
  2. platform data absent  - use "nowait", it can be:
       a. SMC_NOWAIT if defined
       b. default to 0 if SMC_NOWAIT isn't defined
       c. overriden by module parameter

Signed-off-by: Eric Miao <eric.miao@marvell.com>
---
 drivers/net/smc91x.c   |    3 ++-
 include/linux/smc91x.h |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index b57ee44..caa0308 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -279,7 +279,7 @@ static void smc_reset(struct net_device *dev)
 	 * can't handle it then there will be no recovery except for
 	 * a hard reset or power cycle
 	 */
-	if (nowait)
+	if (lp->cfg.flags & SMC91X_NOWAIT)
 		cfg |= CONFIG_NO_WAIT;
 
 	/*
@@ -2142,6 +2142,7 @@ static int smc_drv_probe(struct platform_device *pdev)
 		lp->cfg.flags |= (SMC_CAN_USE_8BIT)  ? SMC91X_USE_8BIT  : 0;
 		lp->cfg.flags |= (SMC_CAN_USE_16BIT) ? SMC91X_USE_16BIT : 0;
 		lp->cfg.flags |= (SMC_CAN_USE_32BIT) ? SMC91X_USE_32BIT : 0;
+		lp->cfg.flags |= (nowait) ? SMC91X_NOWAIT : 0;
 	}
 
 	ndev->dma = (unsigned char)-1;
diff --git a/include/linux/smc91x.h b/include/linux/smc91x.h
index fc7682f..90434db 100644
--- a/include/linux/smc91x.h
+++ b/include/linux/smc91x.h
@@ -5,6 +5,8 @@
 #define SMC91X_USE_16BIT (1 << 1)
 #define SMC91X_USE_32BIT (1 << 2)
 
+#define SMC91X_NOWAIT		(1 << 3)
+
 struct smc91x_platdata {
 	unsigned long flags;
 };
-- 
1.5.4.3


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

* Re: [PATCH 4/8] smc91x: add SMC91X_NOWAIT flag to platform data
  2008-06-19 11:06 [PATCH 4/8] smc91x: add SMC91X_NOWAIT flag to platform data Eric Miao
@ 2008-06-19 16:06 ` Nicolas Pitre
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Pitre @ 2008-06-19 16:06 UTC (permalink / raw)
  To: Eric Miao; +Cc: linux-netdev, linux-arm-kernel, Magnus Damm

On Thu, 19 Jun 2008, Eric Miao wrote:

> 
> And also favors the usage of SMC91X_NOWAIT over the hardcoded SMC_NOWAIT
> by converting "nowait" (module parameter overridable) to platform flag.
> 
> There are several possibilities:
> 
>   1. platform data present - preferred and use as is
>   2. platform data absent  - use "nowait", it can be:
>        a. SMC_NOWAIT if defined
>        b. default to 0 if SMC_NOWAIT isn't defined
>        c. overriden by module parameter
> 
> Signed-off-by: Eric Miao <eric.miao@marvell.com>

Acked-by: Nicolas Pitre <nico@cam.org>

> ---
>  drivers/net/smc91x.c   |    3 ++-
>  include/linux/smc91x.h |    2 ++
>  2 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
> index b57ee44..caa0308 100644
> --- a/drivers/net/smc91x.c
> +++ b/drivers/net/smc91x.c
> @@ -279,7 +279,7 @@ static void smc_reset(struct net_device *dev)
>  	 * can't handle it then there will be no recovery except for
>  	 * a hard reset or power cycle
>  	 */
> -	if (nowait)
> +	if (lp->cfg.flags & SMC91X_NOWAIT)
>  		cfg |= CONFIG_NO_WAIT;
>  
>  	/*
> @@ -2142,6 +2142,7 @@ static int smc_drv_probe(struct platform_device *pdev)
>  		lp->cfg.flags |= (SMC_CAN_USE_8BIT)  ? SMC91X_USE_8BIT  : 0;
>  		lp->cfg.flags |= (SMC_CAN_USE_16BIT) ? SMC91X_USE_16BIT : 0;
>  		lp->cfg.flags |= (SMC_CAN_USE_32BIT) ? SMC91X_USE_32BIT : 0;
> +		lp->cfg.flags |= (nowait) ? SMC91X_NOWAIT : 0;
>  	}
>  
>  	ndev->dma = (unsigned char)-1;
> diff --git a/include/linux/smc91x.h b/include/linux/smc91x.h
> index fc7682f..90434db 100644
> --- a/include/linux/smc91x.h
> +++ b/include/linux/smc91x.h
> @@ -5,6 +5,8 @@
>  #define SMC91X_USE_16BIT (1 << 1)
>  #define SMC91X_USE_32BIT (1 << 2)
>  
> +#define SMC91X_NOWAIT		(1 << 3)
> +
>  struct smc91x_platdata {
>  	unsigned long flags;
>  };
> -- 
> 1.5.4.3
> 


Nicolas

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

end of thread, other threads:[~2008-06-19 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-19 11:06 [PATCH 4/8] smc91x: add SMC91X_NOWAIT flag to platform data Eric Miao
2008-06-19 16:06 ` Nicolas Pitre

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).