summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ibm/emac/tah.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-09-18 22:41:56 +0200
committerDavid S. Miller <davem@davemloft.net>2023-09-20 09:06:39 +0100
commitac35a3c4c8da0b931888cd9a82721a413215adba (patch)
tree53d4e1926aada67b42fc3897c79a0d4b1372f623 /drivers/net/ethernet/ibm/emac/tah.c
parente5a6d397ca2e4b19c04790babf1643c5476a66d2 (diff)
downloadlwn-ac35a3c4c8da0b931888cd9a82721a413215adba.tar.gz
lwn-ac35a3c4c8da0b931888cd9a82721a413215adba.zip
net: ethernet: ibm: 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 these drivers 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>
Diffstat (limited to 'drivers/net/ethernet/ibm/emac/tah.c')
-rw-r--r--drivers/net/ethernet/ibm/emac/tah.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ibm/emac/tah.c b/drivers/net/ethernet/ibm/emac/tah.c
index aae9a88d95d7..fa3488258ca2 100644
--- a/drivers/net/ethernet/ibm/emac/tah.c
+++ b/drivers/net/ethernet/ibm/emac/tah.c
@@ -130,7 +130,7 @@ static int tah_probe(struct platform_device *ofdev)
return rc;
}
-static int tah_remove(struct platform_device *ofdev)
+static void tah_remove(struct platform_device *ofdev)
{
struct tah_instance *dev = platform_get_drvdata(ofdev);
@@ -138,8 +138,6 @@ static int tah_remove(struct platform_device *ofdev)
iounmap(dev->base);
kfree(dev);
-
- return 0;
}
static const struct of_device_id tah_match[] =
@@ -160,7 +158,7 @@ static struct platform_driver tah_driver = {
.of_match_table = tah_match,
},
.probe = tah_probe,
- .remove = tah_remove,
+ .remove_new = tah_remove,
};
int __init tah_init(void)