diff mbox

[U-Boot,03/11] net: sunxi-emac: Add write_hwaddr net_op hook

Message ID 20161108155437.1085-4-oliver@schinagl.nl
State Superseded
Delegated to: Joe Hershberger
Headers show

Commit Message

Olliver Schinagl Nov. 8, 2016, 3:54 p.m. UTC
Expose enetaddr writing via net_ops so that it can be hooked into.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
 drivers/net/sunxi_emac.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Joe Hershberger Nov. 15, 2016, 2:57 a.m. UTC | #1
On Tue, Nov 8, 2016 at 9:54 AM, Olliver Schinagl <oliver@schinagl.nl> wrote:
> Expose enetaddr writing via net_ops so that it can be hooked into.
>
> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff mbox

Patch

diff --git a/drivers/net/sunxi_emac.c b/drivers/net/sunxi_emac.c
index 99339db..dcf832e 100644
--- a/drivers/net/sunxi_emac.c
+++ b/drivers/net/sunxi_emac.c
@@ -554,6 +554,14 @@  static void sunxi_emac_eth_stop(struct udevice *dev)
 	/* Nothing to do here */
 }
 
+static int sunxi_emac_eth_write_hwaddr(struct udevice *dev)
+{
+	struct eth_pdata *pdata = dev_get_platdata(dev);
+	struct emac_eth_dev *priv = dev_get_priv(dev);
+
+	return _sunxi_write_hwaddr(priv, pdata->enetaddr);
+}
+
 static int sunxi_emac_eth_probe(struct udevice *dev)
 {
 	struct eth_pdata *pdata = dev_get_platdata(dev);
@@ -570,6 +578,7 @@  static const struct eth_ops sunxi_emac_eth_ops = {
 	.send			= sunxi_emac_eth_send,
 	.recv			= sunxi_emac_eth_recv,
 	.stop			= sunxi_emac_eth_stop,
+	.write_hwaddr		= sunxi_emac_eth_write_hwaddr,
 };
 
 static int sunxi_emac_eth_ofdata_to_platdata(struct udevice *dev)