From: Sagi Maimon <maimon.sagi@gmail.com>
To: netdev@vger.kernel.org
Cc: radhey.shyam.pandey@amd.com, michal.simek@amd.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux@armlinux.org.uk,
vadim.fedorenko@linux.dev, Sagi Maimon <maimon.sagi@gmail.com>
Subject: [PATCH net-next 2/2] net: axienet: add a MODULE_ALIAS for platform instantiation
Date: Sun, 27 Sep 2026 10:38:43 +0300 [thread overview]
Message-ID: <20260927073843.346910-3-maimon.sagi@gmail.com> (raw)
In-Reply-To: <20260927073843.346910-1-maimon.sagi@gmail.com>
The module is built as xilinx_emac.ko while the platform driver it
registers is named xilinx_axienet. For a device tree instantiation that
mismatch does not matter, because the OF match table supplies the
modalias udev uses to load the module.
A device registered by name from another driver has no OF node and so no
OF modalias. It advertises platform:xilinx_axienet, which matches
nothing, and the device is created but never bound. ptp_ocp is going to
register the AXI Ethernet MAC of the ADVA TimeCard X2 this way, as a
child platform device described by a software node.
Add the corresponding MODULE_ALIAS so name-based instantiation can
autoload the driver, and give the name a define now that it is used in
more than one place.
Tested on the X2 with a local ptp_ocp change: with this patch the module
is loaded and binds when ptp_ocp registers the device; without it the
device stays unbound until xilinx_emac is loaded by hand.
Assisted-by: LLM sparse
Signed-off-by: Sagi Maimon <maimon.sagi@gmail.com>
---
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index cfef8ad75909..ff1837103553 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -48,6 +48,7 @@
#include "xilinx_axienet.h"
/* Descriptors defines for Tx and Rx DMA */
+#define AXIENET_DRIVER_NAME "xilinx_axienet"
#define TX_BD_NUM_DEFAULT 128
#define RX_BD_NUM_DEFAULT 1024
#define TX_BD_NUM_MIN (MAX_SKB_FRAGS + 1)
@@ -3223,7 +3224,7 @@ static struct platform_driver axienet_driver = {
.remove = axienet_remove,
.shutdown = axienet_shutdown,
.driver = {
- .name = "xilinx_axienet",
+ .name = AXIENET_DRIVER_NAME,
.pm = &axienet_pm_ops,
.of_match_table = axienet_of_match,
},
@@ -3231,6 +3232,13 @@ static struct platform_driver axienet_driver = {
module_platform_driver(axienet_driver);
+/* The module is named xilinx_emac, the platform driver xilinx_axienet. A
+ * device registered by name rather than from firmware advertises a
+ * platform:xilinx_axienet modalias, which without this matches no module:
+ * udev cannot autoload the driver and the device stays unbound.
+ */
+MODULE_ALIAS("platform:" AXIENET_DRIVER_NAME);
+
MODULE_DESCRIPTION("Xilinx Axi Ethernet driver");
MODULE_AUTHOR("Xilinx");
MODULE_LICENSE("GPL");
--
2.47.0
prev parent reply other threads:[~2026-09-27 7:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-27 7:38 [PATCH net-next 0/2] net: axienet: allow instantiation without a device tree Sagi Maimon
2026-09-27 7:38 ` [PATCH net-next 1/2] net: axienet: use device_property and fwnode APIs for probe-time config Sagi Maimon
2026-09-27 17:55 ` Andrew Lunn
2026-09-28 7:03 ` Sagi Maimon
2026-09-27 7:38 ` Sagi Maimon [this message]
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=20260927073843.346910-3-maimon.sagi@gmail.com \
--to=maimon.sagi@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=michal.simek@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=radhey.shyam.pandey@amd.com \
--cc=vadim.fedorenko@linux.dev \
/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.