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>
This commit is contained in:
Uwe Kleine-König 2023-03-02 15:47:20 +01:00 committed by Hans de Goede
parent bca92922e2
commit fba53497e3

View file

@ -405,7 +405,7 @@ static int cht_int33fe_typec_probe(struct platform_device *pdev)
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);