mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-10 08:20:16 -05:00
net: ethernet: seeq: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
6e8b0ef7b3
commit
02c74030be
@@ -819,7 +819,7 @@ static int sgiseeq_probe(struct platform_device *pdev)
|
||||
return err;
|
||||
}
|
||||
|
||||
static int sgiseeq_remove(struct platform_device *pdev)
|
||||
static void sgiseeq_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *dev = platform_get_drvdata(pdev);
|
||||
struct sgiseeq_private *sp = netdev_priv(dev);
|
||||
@@ -828,13 +828,11 @@ static int sgiseeq_remove(struct platform_device *pdev)
|
||||
dma_free_noncoherent(&pdev->dev, sizeof(*sp->srings), sp->srings,
|
||||
sp->srings_dma, DMA_BIDIRECTIONAL);
|
||||
free_netdev(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver sgiseeq_driver = {
|
||||
.probe = sgiseeq_probe,
|
||||
.remove = sgiseeq_remove,
|
||||
.remove_new = sgiseeq_remove,
|
||||
.driver = {
|
||||
.name = "sgiseeq",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user