[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200923142528.303730-1-s.riedmueller@phytec.de>
Date: Wed, 23 Sep 2020 16:25:28 +0200
From: Stefan Riedmueller <s.riedmueller@...tec.de>
To: Fugang Duan <fugang.duan@....com>
Cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Christian Hemp <c.hemp@...tec.de>,
Stefan Riedmueller <s.riedmueller@...tec.de>
Subject: [PATCH] net: fec: Keep device numbering consistent with datasheet
From: Christian Hemp <c.hemp@...tec.de>
Make use of device tree alias for device enumeration to keep the device
order consistent with the naming in the datasheet.
Otherwise for the i.MX 6UL/ULL the ENET1 interface is enumerated as eth1
and ENET2 as eth0.
Signed-off-by: Christian Hemp <c.hemp@...tec.de>
Signed-off-by: Stefan Riedmueller <s.riedmueller@...tec.de>
---
drivers/net/ethernet/freescale/fec_main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index fb37816a74db..97dd41bed70a 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3504,6 +3504,7 @@ fec_probe(struct platform_device *pdev)
char irq_name[8];
int irq_cnt;
struct fec_devinfo *dev_info;
+ int eth_id;
fec_enet_get_queue_num(pdev, &num_tx_qs, &num_rx_qs);
@@ -3691,6 +3692,10 @@ fec_probe(struct platform_device *pdev)
ndev->max_mtu = PKT_MAXBUF_SIZE - ETH_HLEN - ETH_FCS_LEN;
+ eth_id = of_alias_get_id(pdev->dev.of_node, "ethernet");
+ if (eth_id >= 0)
+ sprintf(ndev->name, "eth%d", eth_id);
+
ret = register_netdev(ndev);
if (ret)
goto failed_register;
--
2.25.1
Powered by blists - more mailing lists