diff options
author | Yan Burman <burman.yan@gmail.com> | 2006-12-19 16:08:48 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-26 16:41:08 -0500 |
commit | ebf5112ca7a714a3961a322459747059cbf41d7b (patch) | |
tree | 9bcda044319d814d5e05247c7acc96d00dd8cbaf /drivers | |
parent | 3a960f7e350de5d087b88a4c06df236e0f4186fd (diff) |
ep93xx: some minor cleanups to the ep93xx eth driver
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/arm/ep93xx_eth.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c index 8ebd68e2af98..dd698b033a62 100644 --- a/drivers/net/arm/ep93xx_eth.c +++ b/drivers/net/arm/ep93xx_eth.c | |||
@@ -780,12 +780,10 @@ static struct ethtool_ops ep93xx_ethtool_ops = { | |||
780 | struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data) | 780 | struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data) |
781 | { | 781 | { |
782 | struct net_device *dev; | 782 | struct net_device *dev; |
783 | struct ep93xx_priv *ep; | ||
784 | 783 | ||
785 | dev = alloc_etherdev(sizeof(struct ep93xx_priv)); | 784 | dev = alloc_etherdev(sizeof(struct ep93xx_priv)); |
786 | if (dev == NULL) | 785 | if (dev == NULL) |
787 | return NULL; | 786 | return NULL; |
788 | ep = netdev_priv(dev); | ||
789 | 787 | ||
790 | memcpy(dev->dev_addr, data->dev_addr, ETH_ALEN); | 788 | memcpy(dev->dev_addr, data->dev_addr, ETH_ALEN); |
791 | 789 | ||
@@ -840,9 +838,9 @@ static int ep93xx_eth_probe(struct platform_device *pdev) | |||
840 | struct ep93xx_priv *ep; | 838 | struct ep93xx_priv *ep; |
841 | int err; | 839 | int err; |
842 | 840 | ||
843 | data = pdev->dev.platform_data; | ||
844 | if (pdev == NULL) | 841 | if (pdev == NULL) |
845 | return -ENODEV; | 842 | return -ENODEV; |
843 | data = pdev->dev.platform_data; | ||
846 | 844 | ||
847 | dev = ep93xx_dev_alloc(data); | 845 | dev = ep93xx_dev_alloc(data); |
848 | if (dev == NULL) { | 846 | if (dev == NULL) { |