Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit a69da50

Browse files
Uwe Kleine-Königcminyard
authored andcommitted
ipmi: ipmi_ssif: 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() will be 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> Message-Id: <c8a6cd95ad7a8220e211373c44cdaba2a8c06052.1709655755.git.u.kleine-koenig@pengutronix.de> Signed-off-by: Corey Minyard <minyard@acm.org>
1 parent f99a996 commit a69da50

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/char/ipmi/ipmi_ssif.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,15 +2071,14 @@ static int ssif_platform_probe(struct platform_device *dev)
20712071
return dmi_ipmi_probe(dev);
20722072
}
20732073

2074-
static int ssif_platform_remove(struct platform_device *dev)
2074+
static void ssif_platform_remove(struct platform_device *dev)
20752075
{
20762076
struct ssif_addr_info *addr_info = dev_get_drvdata(&dev->dev);
20772077

20782078
mutex_lock(&ssif_infos_mutex);
20792079
list_del(&addr_info->link);
20802080
kfree(addr_info);
20812081
mutex_unlock(&ssif_infos_mutex);
2082-
return 0;
20832082
}
20842083

20852084
static const struct platform_device_id ssif_plat_ids[] = {
@@ -2092,7 +2091,7 @@ static struct platform_driver ipmi_driver = {
20922091
.name = DEVICE_NAME,
20932092
},
20942093
.probe = ssif_platform_probe,
2095-
.remove = ssif_platform_remove,
2094+
.remove_new = ssif_platform_remove,
20962095
.id_table = ssif_plat_ids
20972096
};
20982097

0 commit comments

Comments
 (0)