summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/intel/chtwc_int33fe.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-02 17:47:20 +0300
committerHans de Goede <hdegoede@redhat.com>2023-03-07 14:20:25 +0300
commitfba53497e3c0572a2d621bbd98615c6e07a9e518 (patch)
tree4eb78b7a69f818af616f8f123cdd7f120ebd7bf3 /drivers/platform/x86/intel/chtwc_int33fe.c
parentbca92922e2a7800adf9d965e409f7ecb74ce9494 (diff)
downloadlinux-fba53497e3c0572a2d621bbd98615c6e07a9e518.tar.xz
platform/x86: intel: chtwc_int33fe: 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 (mostly) ignored 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. 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/20230302144732.1903781-18-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/intel/chtwc_int33fe.c')
-rw-r--r--drivers/platform/x86/intel/chtwc_int33fe.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/platform/x86/intel/chtwc_int33fe.c b/drivers/platform/x86/intel/chtwc_int33fe.c
index 2c9a7d52be07..848baecc1bb0 100644
--- a/drivers/platform/x86/intel/chtwc_int33fe.c
+++ b/drivers/platform/x86/intel/chtwc_int33fe.c
@@ -405,7 +405,7 @@ out_remove_nodes:
return ret;
}
-static int cht_int33fe_typec_remove(struct platform_device *pdev)
+static void cht_int33fe_typec_remove(struct platform_device *pdev)
{
struct cht_int33fe_data *data = platform_get_drvdata(pdev);
@@ -414,8 +414,6 @@ static int cht_int33fe_typec_remove(struct platform_device *pdev)
i2c_unregister_device(data->battery_fg);
cht_int33fe_remove_nodes(data);
-
- return 0;
}
static const struct acpi_device_id cht_int33fe_acpi_ids[] = {
@@ -429,7 +427,7 @@ static struct platform_driver cht_int33fe_typec_driver = {
.acpi_match_table = ACPI_PTR(cht_int33fe_acpi_ids),
},
.probe = cht_int33fe_typec_probe,
- .remove = cht_int33fe_typec_remove,
+ .remove_new = cht_int33fe_typec_remove,
};
module_platform_driver(cht_int33fe_typec_driver);