]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NET] smc91x: favor the use of SMC91X_USE_* instead of SMC_CAN_USE_*
authorEric Miao <eric.miao@marvell.com>
Thu, 19 Jun 2008 09:19:57 +0000 (17:19 +0800)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 12 Jul 2008 20:52:40 +0000 (21:52 +0100)
Let's simplify the logic and avoid confusion, the use of SMC91X_USE_*
is favored than SMC_CAN_USE_*, if platform data isn't given, convert
the hardcoded SMC_CAN_USE_* to SMC91X_USE_*.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/net/smc91x.c
drivers/net/smc91x.h

index e4a6c361995a1a7df6ca8fc1d00156dcd3b300fc..1b19022b6c7ca7a379d92f373f9d9fc86c5e4268 100644 (file)
@@ -2154,20 +2154,14 @@ static int smc_drv_probe(struct platform_device *pdev)
 
        lp = netdev_priv(ndev);
 
-#ifdef SMC_DYNAMIC_BUS_CONFIG
        if (pd)
                memcpy(&lp->cfg, pd, sizeof(lp->cfg));
        else {
-               lp->cfg.flags = SMC91X_USE_8BIT;
-               lp->cfg.flags |= SMC91X_USE_16BIT;
-               lp->cfg.flags |= SMC91X_USE_32BIT;
+               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 &= ~(SMC_CAN_USE_8BIT ? 0 : SMC91X_USE_8BIT);
-       lp->cfg.flags &= ~(SMC_CAN_USE_16BIT ? 0 : SMC91X_USE_16BIT);
-       lp->cfg.flags &= ~(SMC_CAN_USE_32BIT ? 0 : SMC91X_USE_32BIT);
-#endif
-
        ndev->dma = (unsigned char)-1;
 
        ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
index 8606818653f88601fb63896b3aa0fcf19e169dae..8310f1a073d86c68778b2b0e46ce651f96f1bcec 100644 (file)
@@ -454,7 +454,6 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r,
 #define RPC_LSA_DEFAULT                RPC_LED_100_10
 #define RPC_LSB_DEFAULT                RPC_LED_TX_RX
 
-#define SMC_DYNAMIC_BUS_CONFIG
 #endif
 
 
@@ -504,15 +503,9 @@ struct smc_local {
        struct smc91x_platdata cfg;
 };
 
-#ifdef SMC_DYNAMIC_BUS_CONFIG
-#define SMC_8BIT(p) (((p)->cfg.flags & SMC91X_USE_8BIT) && SMC_CAN_USE_8BIT)
-#define SMC_16BIT(p) (((p)->cfg.flags & SMC91X_USE_16BIT) && SMC_CAN_USE_16BIT)
-#define SMC_32BIT(p) (((p)->cfg.flags & SMC91X_USE_32BIT) && SMC_CAN_USE_32BIT)
-#else
-#define SMC_8BIT(p) SMC_CAN_USE_8BIT
-#define SMC_16BIT(p) SMC_CAN_USE_16BIT
-#define SMC_32BIT(p) SMC_CAN_USE_32BIT
-#endif
+#define SMC_8BIT(p)    ((p)->cfg.flags & SMC91X_USE_8BIT)
+#define SMC_16BIT(p)   ((p)->cfg.flags & SMC91X_USE_16BIT)
+#define SMC_32BIT(p)   ((p)->cfg.flags & SMC91X_USE_32BIT)
 
 #ifdef SMC_USE_PXA_DMA
 /*