Commit 6f0b985d authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'net-platform-remove-void'



Uwe Kleine-König says:

====================
net: ethernet: Convert to platform remove callback returning void

this series convert nearly all platform drivers below
drivers/net/ethernet to use remove_new. The motivation is to get rid of
an integer return code that is (mostly) ignored by the platform driver
core and error prone on the driver side.

There are 3 drivers I didn't convert (yet):

 drivers/net/ethernet/ti/cpsw.c
 drivers/net/ethernet/ti/cpsw_new.c
 drivers/net/ethernet/ti/am65-cpsw-nuss.c

These are a bit more complicated because they don't always return 0 in
.remove(). Unless someone is quicker than me, I'll address them in
separate patches at a later time.

See commit 5c5a7680 ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.

There are no interdependencies between the patches. As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply, please apply the remainder of this series anyhow.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5bed8d58 d74a5c15
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -811,7 +811,7 @@ static int ax_init_dev(struct net_device *dev)
	return ret;
}

static int ax_remove(struct platform_device *pdev)
static void ax_remove(struct platform_device *pdev)
{
	struct net_device *dev = platform_get_drvdata(pdev);
	struct ei_device *ei_local = netdev_priv(dev);
@@ -832,8 +832,6 @@ static int ax_remove(struct platform_device *pdev)

	platform_set_drvdata(pdev, NULL);
	free_netdev(dev);

	return 0;
}

/*
@@ -1011,7 +1009,7 @@ static struct platform_driver axdrv = {
		.name		= "ax88796",
	},
	.probe		= ax_probe,
	.remove		= ax_remove,
	.remove_new	= ax_remove,
	.suspend	= ax_suspend,
	.resume		= ax_resume,
};
+2 −3
Original line number Diff line number Diff line
@@ -441,7 +441,7 @@ static int mcf8390_probe(struct platform_device *pdev)
	return 0;
}

static int mcf8390_remove(struct platform_device *pdev)
static void mcf8390_remove(struct platform_device *pdev)
{
	struct net_device *dev = platform_get_drvdata(pdev);
	struct resource *mem;
@@ -450,7 +450,6 @@ static int mcf8390_remove(struct platform_device *pdev)
	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	release_mem_region(mem->start, resource_size(mem));
	free_netdev(dev);
	return 0;
}

static struct platform_driver mcf8390_drv = {
@@ -458,7 +457,7 @@ static struct platform_driver mcf8390_drv = {
		.name	= "mcf8390",
	},
	.probe		= mcf8390_probe,
	.remove		= mcf8390_remove,
	.remove_new	= mcf8390_remove,
};

module_platform_driver(mcf8390_drv);
+2 −3
Original line number Diff line number Diff line
@@ -823,7 +823,7 @@ static int __init ne_drv_probe(struct platform_device *pdev)
	return 0;
}

static int ne_drv_remove(struct platform_device *pdev)
static void ne_drv_remove(struct platform_device *pdev)
{
	struct net_device *dev = platform_get_drvdata(pdev);

@@ -842,7 +842,6 @@ static int ne_drv_remove(struct platform_device *pdev)
		release_region(dev->base_addr, NE_IO_EXTENT);
		free_netdev(dev);
	}
	return 0;
}

/* Remove unused devices or all if true. */
@@ -895,7 +894,7 @@ static int ne_drv_resume(struct platform_device *pdev)
#endif

static struct platform_driver ne_driver = {
	.remove		= ne_drv_remove,
	.remove_new	= ne_drv_remove,
	.suspend	= ne_drv_suspend,
	.resume		= ne_drv_resume,
	.driver		= {
+2 −4
Original line number Diff line number Diff line
@@ -1582,15 +1582,13 @@ static int owl_emac_probe(struct platform_device *pdev)
	return 0;
}

static int owl_emac_remove(struct platform_device *pdev)
static void owl_emac_remove(struct platform_device *pdev)
{
	struct owl_emac_priv *priv = platform_get_drvdata(pdev);

	netif_napi_del(&priv->napi);
	phy_disconnect(priv->netdev->phydev);
	cancel_work_sync(&priv->mac_reset_task);

	return 0;
}

static const struct of_device_id owl_emac_of_match[] = {
@@ -1609,7 +1607,7 @@ static struct platform_driver owl_emac_driver = {
		.pm = &owl_emac_pm_ops,
	},
	.probe = owl_emac_probe,
	.remove = owl_emac_remove,
	.remove_new = owl_emac_remove,
};
module_platform_driver(owl_emac_driver);

+2 −4
Original line number Diff line number Diff line
@@ -1525,7 +1525,7 @@ static int greth_of_probe(struct platform_device *ofdev)
	return err;
}

static int greth_of_remove(struct platform_device *of_dev)
static void greth_of_remove(struct platform_device *of_dev)
{
	struct net_device *ndev = platform_get_drvdata(of_dev);
	struct greth_private *greth = netdev_priv(ndev);
@@ -1544,8 +1544,6 @@ static int greth_of_remove(struct platform_device *of_dev)
	of_iounmap(&of_dev->resource[0], greth->regs, resource_size(&of_dev->resource[0]));

	free_netdev(ndev);

	return 0;
}

static const struct of_device_id greth_of_match[] = {
@@ -1566,7 +1564,7 @@ static struct platform_driver greth_of_driver = {
		.of_match_table = greth_of_match,
	},
	.probe = greth_of_probe,
	.remove = greth_of_remove,
	.remove_new = greth_of_remove,
};

module_platform_driver(greth_of_driver);
Loading