From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net-next] net: enc28j60: use of_get_ethdev_address
Date: Sun, 26 Apr 2026 22:25:33 -0700 [thread overview]
Message-ID: <20260427052533.960487-1-rosenp@gmail.com> (raw)
Since this is an OF only driver, of_ instead of device_ allows nvmem to
be used to specify the MAC address.
Add EPROBE_DEFER handling for NVMEM.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/ethernet/microchip/enc28j60.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/microchip/enc28j60.c b/drivers/net/ethernet/microchip/enc28j60.c
index d6c9491537e4..2b9b4163e419 100644
--- a/drivers/net/ethernet/microchip/enc28j60.c
+++ b/drivers/net/ethernet/microchip/enc28j60.c
@@ -24,6 +24,7 @@
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/spi/spi.h>
+#include <linux/of_net.h>
#include "enc28j60_hw.h"
@@ -1554,7 +1555,10 @@ static int enc28j60_probe(struct spi_device *spi)
goto error_irq;
}
- if (device_get_ethdev_address(&spi->dev, dev))
+ ret = of_get_ethdev_address(spi->dev.of_node, dev);
+ if (ret == -EPROBE_DEFER)
+ return ret;
+ if (ret)
eth_hw_addr_random(dev);
enc28j60_set_hw_macaddr(dev);
--
2.54.0
next reply other threads:[~2026-04-27 5:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 5:25 Rosen Penev [this message]
2026-04-27 14:19 ` [PATCH net-next] net: enc28j60: use of_get_ethdev_address Andrew Lunn
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=20260427052533.960487-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox