[U-Boot] [PATCH 4/4] net: fec: Zap local mac variable

Jagan Teki jagan at openedev.com
Thu Nov 3 20:43:34 CET 2016


From: Jagan Teki <jagan at amarulasolutions.com>

Call dev->enetaddr or pdata->enetaddr directly
in eth_ops instead of local mac variable.

Cc: Stefano Babic <sbabic at denx.de>
Cc: Matteo Lisi <matteo.lisi at engicam.com>
Cc: Michael Trimarchi <michael at amarulasolutions.com>
Cc: Joe Hershberger <joe.hershberger at ni.com>
Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 drivers/net/fec_mxc.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 746faed..13daae1 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -934,9 +934,8 @@ struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id)
 static int fec_recv(struct eth_device *dev)
 {
 	struct fec_priv *fec = (struct fec_priv *)dev->priv;
-	uchar *mac = dev->enetaddr;
 
-	return _fec_recv(fec, mac);
+	return _fec_recv(fec, dev->enetaddr);
 }
 
 static int fec_send(struct eth_device *dev, void *packet, int length)
@@ -956,17 +955,15 @@ static void fec_halt(struct eth_device *dev)
 static int fec_set_hwaddr(struct eth_device *dev)
 {
 	struct fec_priv *fec = (struct fec_priv *)dev->priv;
-	uchar *mac = dev->enetaddr;
 
-	return _fec_set_hwaddr(fec, mac);
+	return _fec_set_hwaddr(fec, dev->enetaddr);
 }
 
 static int fec_init(struct eth_device *dev, bd_t *bd)
 {
 	struct fec_priv *fec = (struct fec_priv *)dev->priv;
-	uchar *mac = dev->enetaddr;
 
-	return _fec_init(fec, mac);
+	return _fec_init(fec, dev->enetaddr);
 }
 
 static int fec_get_hwaddr(int dev_id, unsigned char *mac)
@@ -1142,9 +1139,8 @@ static int fec_set_hwaddr(struct udevice *dev)
 {
 	struct fec_priv *fec = dev_get_priv(dev);
 	struct eth_pdata *pdata = dev_get_platdata(dev);
-	uchar *mac = pdata->enetaddr;
 
-	return _fec_set_hwaddr(fec, mac);
+	return _fec_set_hwaddr(fec, pdata->enetaddr);
 }
 
 static void fec_halt(struct udevice *dev)
@@ -1158,9 +1154,8 @@ static int fec_recv(struct udevice *dev, int flags, uchar **packetp)
 {
 	struct fec_priv *fec = dev_get_priv(dev);
 	struct eth_pdata *pdata = dev_get_platdata(dev);
-	uchar *mac = pdata->enetaddr;
 
-	return _fec_recv(fec, mac);
+	return _fec_recv(fec, pdata->enetaddr);
 }
 
 static int fec_send(struct udevice *dev, void *packet, int length)
@@ -1174,9 +1169,8 @@ static int fec_init(struct udevice *dev)
 {
 	struct fec_priv *fec = dev_get_priv(dev);
 	struct eth_pdata *pdata = dev_get_platdata(dev);
-	uchar *mac = pdata->enetaddr;
 
-	return _fec_init(fec, mac);
+	return _fec_init(fec, pdata->enetaddr);
 }
 
 static const struct eth_ops fecmxc_ops = {
-- 
1.9.1



More information about the U-Boot mailing list