Skip to contentSkip to conversation

drivers/net/smc911x.c: smc911x_drv_probe() cleanup

PATCH In review [email protected] 1 participant 1 message Dec 1, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 drivers/net/smc911x.c: smc911x_drv_probe() cleanup

From: Andrew Morton <[email protected]>

Save an ugly ifdef.

Cc "Dasgupta, Romit" <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Jeff Garzik <[email protected]>
Cc Romit Dasgupta <[email protected]>

---

 drivers/net/smc911x.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/smc911x.c renamed from drivers/net/smc911x.c~netdev-smc911x-fix-for-driver-resume-cleanup +7 -7
diff -puN drivers/net/smc911x.c~netdev-smc911x-fix-for-driver-resume-cleanup drivers/net/smc911x.c
@@ -2050,9 +2050,6 @@ err_out:
  */
 static int __devinit smc911x_drv_probe(struct platform_device *pdev)
 {
-#ifdef SMC_DYNAMIC_BUS_CONFIG
-	struct smc911x_platdata *pd = pdev->dev.platform_data;
-#endif
 	struct net_device *ndev;
 	struct resource *res;
 	struct smc911x_local *lp;
@@ -2087,11 +2084,14 @@ static int __devinit smc911x_drv_probe(s
 	lp = netdev_priv(ndev);
 	lp->netdev = ndev;
 #ifdef SMC_DYNAMIC_BUS_CONFIG
-	if (!pd) {
-		ret = -EINVAL;
-		goto release_both;
+	{
+		struct smc911x_platdata *pd = pdev->dev.platform_data;
+		if (!pd) {
+			ret = -EINVAL;
+			goto release_both;
+		}
+		memcpy(&lp->cfg, pd, sizeof(lp->cfg));
 	}
-	memcpy(&lp->cfg, pd, sizeof(lp->cfg));
 #endif
 
 	addr = ioremap(res->start, SMC911X_IO_EXTENT);

_