Skip to contentSkip to conversation

ep93xx: Some minor cleanups to the ep93xx eth driver

PATCH New Yan Burman 1 participant 1 message Dec 12, 2006 Network drivers

lore
Share & tools
lore

Yan Burman

author
#0 lore raw

PATCH 1/1 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.

drivers/net/arm/ep93xx_eth.c +1 -3
@@ -780,12 +780,10 @@ static struct ethtool_ops ep93xx_ethtool
 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 platf
 	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) {