ep93xx: some minor cleanups to the ep93xx eth driver
authorYan Burman <burman.yan@gmail.com>
Tue, 19 Dec 2006 21:08:48 +0000 (13:08 -0800)
committerJeff Garzik <jeff@garzik.org>
Tue, 26 Dec 2006 21:41:08 +0000 (16:41 -0500)
Small cleanup in the Cirrus Logic EP93xx ethernet driver: Check for NULL
pointer before dereferencing it instead of after.  Remove unreferenced
variable.

Signed-off-by: Yan Burman <burman.yan@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/arm/ep93xx_eth.c

index 8ebd68e2af98229374e43dc2b45285e8fd2fd6a1..dd698b033a6200070c54d908eb21cc8101a2e2ab 100644 (file)
@@ -780,12 +780,10 @@ static struct ethtool_ops ep93xx_ethtool_ops = {
 struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data)
 {
        struct net_device *dev;
-       struct ep93xx_priv *ep;
 
        dev = alloc_etherdev(sizeof(struct ep93xx_priv));
        if (dev == NULL)
                return NULL;
-       ep = netdev_priv(dev);
 
        memcpy(dev->dev_addr, data->dev_addr, ETH_ALEN);
 
@@ -840,9 +838,9 @@ static int ep93xx_eth_probe(struct platform_device *pdev)
        struct ep93xx_priv *ep;
        int err;
 
-       data = pdev->dev.platform_data;
        if (pdev == NULL)
                return -ENODEV;
+       data = pdev->dev.platform_data;
 
        dev = ep93xx_dev_alloc(data);
        if (dev == NULL) {