aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-09-18 15:36:55 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2023-09-18 20:08:03 +0200
commit83ef1dbc0de4a127661a175350696e9cfa88bbb1 (patch)
treebe7a42f17ed067af8dc65d7a6234344ae8e2cfed /drivers/power
parent07a9398914327bb16584f24dfba02062a5967ab1 (diff)
downloadlinux-83ef1dbc0de4a127661a175350696e9cfa88bbb1.tar.gz
power: supply: twl4030_charger: 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> Link: https://lore.kernel.org/r/20230918133700.1254499-28-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/twl4030_charger.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/supply/twl4030_charger.c
index e78d061d8d326..7b9b0b3e164e0 100644
--- a/drivers/power/supply/twl4030_charger.c
+++ b/drivers/power/supply/twl4030_charger.c
@@ -1108,7 +1108,7 @@ static int twl4030_bci_probe(struct platform_device *pdev)
return 0;
}
-static int twl4030_bci_remove(struct platform_device *pdev)
+static void twl4030_bci_remove(struct platform_device *pdev)
{
struct twl4030_bci *bci = platform_get_drvdata(pdev);
@@ -1123,8 +1123,6 @@ static int twl4030_bci_remove(struct platform_device *pdev)
TWL4030_INTERRUPTS_BCIIMR1A);
twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff,
TWL4030_INTERRUPTS_BCIIMR2A);
-
- return 0;
}
static const struct of_device_id twl_bci_of_match[] __maybe_unused = {
@@ -1135,7 +1133,7 @@ MODULE_DEVICE_TABLE(of, twl_bci_of_match);
static struct platform_driver twl4030_bci_driver = {
.probe = twl4030_bci_probe,
- .remove = twl4030_bci_remove,
+ .remove_new = twl4030_bci_remove,
.driver = {
.name = "twl4030_bci",
.of_match_table = of_match_ptr(twl_bci_of_match),