rockchip: stmmac: add devname configuration from OF
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 9353f90342)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
@@ -7149,6 +7149,7 @@ int stmmac_dvr_probe(struct device *devi
|
||||
{
|
||||
struct net_device *ndev = NULL;
|
||||
struct stmmac_priv *priv;
|
||||
+ const char *devname = of_get_property(device->of_node, "label", NULL);
|
||||
u32 rxq;
|
||||
int i, ret = 0;
|
||||
|
||||
@@ -7157,6 +7158,9 @@ int stmmac_dvr_probe(struct device *devi
|
||||
if (!ndev)
|
||||
return -ENOMEM;
|
||||
|
||||
+ if (devname)
|
||||
+ strlcpy(ndev->name, devname, IFNAMSIZ);
|
||||
+
|
||||
SET_NETDEV_DEV(ndev, device);
|
||||
|
||||
priv = netdev_priv(ndev);
|
||||
Reference in New Issue
Block a user