Commit bd883286 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Jarkko Sakkinen

tpm/tpm_ftpm_tee: 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.

ftpm_tee_remove() returns zero unconditionally (and cannot easily
converted to return void). So ignore the return value to be able to make
ftpm_plat_tee_remove() return void.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
parent 3fb29a23
...@@ -334,11 +334,11 @@ static int ftpm_tee_remove(struct device *dev) ...@@ -334,11 +334,11 @@ static int ftpm_tee_remove(struct device *dev)
return 0; return 0;
} }
static int ftpm_plat_tee_remove(struct platform_device *pdev) static void ftpm_plat_tee_remove(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
return ftpm_tee_remove(dev); ftpm_tee_remove(dev);
} }
/** /**
...@@ -367,7 +367,7 @@ static struct platform_driver ftpm_tee_plat_driver = { ...@@ -367,7 +367,7 @@ static struct platform_driver ftpm_tee_plat_driver = {
}, },
.shutdown = ftpm_plat_tee_shutdown, .shutdown = ftpm_plat_tee_shutdown,
.probe = ftpm_plat_tee_probe, .probe = ftpm_plat_tee_probe,
.remove = ftpm_plat_tee_remove, .remove_new = ftpm_plat_tee_remove,
}; };
/* UUID of the fTPM TA */ /* UUID of the fTPM TA */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment