From: Jagan Teki <jagan@openedev.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/7] net: fec: Zap local mac variable
Date: Wed, 9 Nov 2016 17:20:00 +0530 [thread overview]
Message-ID: <1478692203-4442-5-git-send-email-jagan@openedev.com> (raw)
In-Reply-To: <1478692203-4442-1-git-send-email-jagan@openedev.com>
From: Jagan Teki <jagan@amarulasolutions.com>
Call dev->enetaddr or pdata->enetaddr directly
in eth_ops instead of local mac variable.
Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Jagan Teki <jagan@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 09433df..787823c 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
next prev parent reply other threads:[~2016-11-09 11:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 11:49 [U-Boot] [PATCH v2 0/7] imx6: Add Engicam GEAM6UL/i.CoreM6 RQS board support Jagan Teki
2016-11-09 11:49 ` [U-Boot] [PATCH v2 1/7] arm: dts: Add devicetree for i.MX6UL Jagan Teki
2016-11-09 11:49 ` [U-Boot] [PATCH v2 2/7] arm: imx6ul: Add Engicam GEAM6UL Starter Kit initial support Jagan Teki
2016-11-09 11:49 ` [U-Boot] [PATCH v2 3/7] dm: net: fec: Add .read_rom_hwaddr Jagan Teki
2016-11-09 11:50 ` Jagan Teki [this message]
2016-11-09 11:50 ` [U-Boot] [PATCH v2 5/7] arm: imx6q: Add Engicam i.CoreM6 Quad/Dual RQS Starter Kit initial support Jagan Teki
2016-11-09 11:50 ` [U-Boot] [PATCH v2 6/7] arm: imx6q: Add Engicam i.CoreM6 Solo/Duallite " Jagan Teki
2016-11-09 11:50 ` [U-Boot] [PATCH v2 7/7] imx6: icorem6: Rename engicam icorem6 defconfig files Jagan Teki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1478692203-4442-5-git-send-email-jagan@openedev.com \
--to=jagan@openedev.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.