mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
soc: qcom: smsm: 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> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-29-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
parent
1cd966c2dc
commit
bdd7cc62cf
@ -613,7 +613,7 @@ out_put:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int qcom_smsm_remove(struct platform_device *pdev)
|
||||
static void qcom_smsm_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct qcom_smsm *smsm = platform_get_drvdata(pdev);
|
||||
unsigned id;
|
||||
@ -623,8 +623,6 @@ static int qcom_smsm_remove(struct platform_device *pdev)
|
||||
irq_domain_remove(smsm->entries[id].domain);
|
||||
|
||||
qcom_smem_state_unregister(smsm->state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id qcom_smsm_of_match[] = {
|
||||
@ -635,7 +633,7 @@ MODULE_DEVICE_TABLE(of, qcom_smsm_of_match);
|
||||
|
||||
static struct platform_driver qcom_smsm_driver = {
|
||||
.probe = qcom_smsm_probe,
|
||||
.remove = qcom_smsm_remove,
|
||||
.remove_new = qcom_smsm_remove,
|
||||
.driver = {
|
||||
.name = "qcom-smsm",
|
||||
.of_match_table = qcom_smsm_of_match,
|
||||
|
Loading…
Reference in New Issue
Block a user