Skip to contentSkip to conversation

smc91x: add SMC91X_NOWAIT flag to platform data

PATCH NAK Eric Miao 2 participants 2 messages Jun 19, 2008

Subsystems (2)
lore
Share & tools
lore

Eric Miao

author
#0 lore raw

PATCH 4/8 smc91x: add SMC91X_NOWAIT flag to platform data

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

---
 drivers/net/smc91x.c   |    3 ++-
 include/linux/smc91x.h |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)
drivers/net/smc91x.c +2 -1
index b57ee44..caa0308 100644
@@ -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;
include/linux/smc91x.h +2 -0
index fc7682f..90434db 100644
@@ -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;
 };
Signature · 1 line
1.5.4.3
Acked-by on v1 4/8
#1 lore raw
Quoted 6 lines · Eric Miao

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:

Quoted 7 lines

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

Quoted 42 lines
---
 drivers/net/smc91x.c   |    3 ++-
 include/linux/smc91x.h |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)
drivers/net/smc91x.c +2 -1
index b57ee44..caa0308 100644
@@ -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;
include/linux/smc91x.h +2 -0
index fc7682f..90434db 100644
@@ -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;
 };
Signature · 1 line
1.5.4.3

Nicolas