]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
drivers/net/smc911x.c: smc911x_drv_probe() cleanup
authorAndrew Morton <akpm@linux-foundation.org>
Mon, 1 Dec 2008 12:24:46 +0000 (12:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Dec 2008 05:05:49 +0000 (21:05 -0800)
Save an ugly ifdef.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/smc911x.c

index 21d823c0892ce67655f0a05d6b0ba517608a14ba..bf3aa2a1effed6fa6301fc675d01bbf33e9d72fd 100644 (file)
@@ -2048,9 +2048,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;
@@ -2085,11 +2082,14 @@ static int __devinit smc911x_drv_probe(struct platform_device *pdev)
        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);