mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 02:01:36 +03:00
nvethernet: get interface name from DT
Bug 200763996 Change-Id: I7a6636eeace9aff162763aa8260d9d1eda3a9216 Signed-off-by: Bhadram Varka <vbhadram@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2587523 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Revanth Kumar Uppala
parent
2a68302c12
commit
eee46a197b
@@ -5963,6 +5963,7 @@ static int ether_probe(struct platform_device *pdev)
|
|||||||
struct net_device *ndev;
|
struct net_device *ndev;
|
||||||
int ret = 0, i, val;
|
int ret = 0, i, val;
|
||||||
void __iomem *reg;
|
void __iomem *reg;
|
||||||
|
const char *if_name;
|
||||||
|
|
||||||
/* WAR to program PAD control registers until MB1 changes done */
|
/* WAR to program PAD control registers until MB1 changes done */
|
||||||
if (tegra_get_chip_id() == TEGRA234) {
|
if (tegra_get_chip_id() == TEGRA234) {
|
||||||
@@ -6030,9 +6031,18 @@ static int ether_probe(struct platform_device *pdev)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate and set up the ethernet device */
|
if_name = (const char *)of_get_property(pdev->dev.of_node,
|
||||||
ndev = alloc_etherdev_mq((int)sizeof(struct ether_priv_data),
|
"nvidia,if-name", NULL);
|
||||||
num_dma_chans);
|
if (if_name) {
|
||||||
|
ndev = alloc_netdev_mqs((int)sizeof(struct ether_priv_data), if_name,
|
||||||
|
NET_NAME_UNKNOWN, ether_setup,
|
||||||
|
num_dma_chans, num_dma_chans);
|
||||||
|
} else {
|
||||||
|
/* allocate and set up the ethernet device */
|
||||||
|
ndev = alloc_etherdev_mq((int)sizeof(struct ether_priv_data),
|
||||||
|
num_dma_chans);
|
||||||
|
}
|
||||||
|
|
||||||
if (ndev == NULL) {
|
if (ndev == NULL) {
|
||||||
dev_err(&pdev->dev, "failed to allocate net device\n");
|
dev_err(&pdev->dev, "failed to allocate net device\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|||||||
Reference in New Issue
Block a user