Skip to content

Commit ede778e

Browse files
Uwe Kleine-Königdavem330
authored andcommitted
net: ethernet: sunplus: 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>
1 parent 8f4e45a commit ede778e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/net/ethernet/sunplus/spl2sw_driver.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static int spl2sw_probe(struct platform_device *pdev)
511511
return ret;
512512
}
513513

514-
static int spl2sw_remove(struct platform_device *pdev)
514+
static void spl2sw_remove(struct platform_device *pdev)
515515
{
516516
struct spl2sw_common *comm;
517517
int i;
@@ -538,8 +538,6 @@ static int spl2sw_remove(struct platform_device *pdev)
538538
spl2sw_mdio_remove(comm);
539539

540540
clk_disable_unprepare(comm->clk);
541-
542-
return 0;
543541
}
544542

545543
static const struct of_device_id spl2sw_of_match[] = {
@@ -551,7 +549,7 @@ MODULE_DEVICE_TABLE(of, spl2sw_of_match);
551549

552550
static struct platform_driver spl2sw_driver = {
553551
.probe = spl2sw_probe,
554-
.remove = spl2sw_remove,
552+
.remove_new = spl2sw_remove,
555553
.driver = {
556554
.name = "sp7021_emac",
557555
.of_match_table = spl2sw_of_match,

0 commit comments

Comments
 (0)