6.1-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit b40eeedbbc0833716b5ccae64cf914f2604a3e5e, which was upstream commit 2eb5e25d8495 ("net: ibm/emac: allocate dummy net_device dynamically").
alloc_netdev_dummy(( does not exist in 6.1, so all this backport did was break the build.
Signed-off-by: Sasha Levin sashal@kernel.org --- drivers/net/ethernet/ibm/emac/mal.c | 14 +++----------- drivers/net/ethernet/ibm/emac/mal.h | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c index 1ebe44804f9d0..f30a2b8a7c173 100644 --- a/drivers/net/ethernet/ibm/emac/mal.c +++ b/drivers/net/ethernet/ibm/emac/mal.c @@ -603,13 +603,9 @@ static int mal_probe(struct platform_device *ofdev) INIT_LIST_HEAD(&mal->list); spin_lock_init(&mal->lock);
- mal->dummy_dev = alloc_netdev_dummy(0); - if (!mal->dummy_dev) { - err = -ENOMEM; - goto fail_unmap; - } + init_dummy_netdev(&mal->dummy_dev);
- netif_napi_add_weight(mal->dummy_dev, &mal->napi, mal_poll, + netif_napi_add_weight(&mal->dummy_dev, &mal->napi, mal_poll, CONFIG_IBM_EMAC_POLL_WEIGHT);
/* Load power-on reset defaults */ @@ -639,7 +635,7 @@ static int mal_probe(struct platform_device *ofdev) GFP_KERNEL); if (mal->bd_virt == NULL) { err = -ENOMEM; - goto fail_dummy; + goto fail_unmap; }
for (i = 0; i < mal->num_tx_chans; ++i) @@ -705,8 +701,6 @@ static int mal_probe(struct platform_device *ofdev) free_irq(mal->serr_irq, mal); fail2: dma_free_coherent(&ofdev->dev, bd_size, mal->bd_virt, mal->bd_dma); - fail_dummy: - free_netdev(mal->dummy_dev); fail_unmap: dcr_unmap(mal->dcr_host, 0x100); fail: @@ -738,8 +732,6 @@ static int mal_remove(struct platform_device *ofdev)
mal_reset(mal);
- free_netdev(mal->dummy_dev); - dcr_unmap(mal->dcr_host, 0x100);
dma_free_coherent(&ofdev->dev, diff --git a/drivers/net/ethernet/ibm/emac/mal.h b/drivers/net/ethernet/ibm/emac/mal.h index e0ddc41186a28..d212373a72e7c 100644 --- a/drivers/net/ethernet/ibm/emac/mal.h +++ b/drivers/net/ethernet/ibm/emac/mal.h @@ -205,7 +205,7 @@ struct mal_instance { int index; spinlock_t lock;
- struct net_device *dummy_dev; + struct net_device dummy_dev;
unsigned int features; };