mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
ASoC: qcom: lpass: Make asoc_qcom_lpass_cpu_platform_remove() return 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. asoc_qcom_lpass_cpu_platform_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231013221945.1489203-15-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
8210f496c3
commit
d0cc676c42
@ -300,7 +300,7 @@ static struct platform_driver apq8016_lpass_cpu_platform_driver = {
|
|||||||
.of_match_table = of_match_ptr(apq8016_lpass_cpu_device_id),
|
.of_match_table = of_match_ptr(apq8016_lpass_cpu_device_id),
|
||||||
},
|
},
|
||||||
.probe = asoc_qcom_lpass_cpu_platform_probe,
|
.probe = asoc_qcom_lpass_cpu_platform_probe,
|
||||||
.remove = asoc_qcom_lpass_cpu_platform_remove,
|
.remove_new = asoc_qcom_lpass_cpu_platform_remove,
|
||||||
};
|
};
|
||||||
module_platform_driver(apq8016_lpass_cpu_platform_driver);
|
module_platform_driver(apq8016_lpass_cpu_platform_driver);
|
||||||
|
|
||||||
|
@ -1274,15 +1274,12 @@ err:
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_probe);
|
EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_probe);
|
||||||
|
|
||||||
int asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev)
|
void asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct lpass_data *drvdata = platform_get_drvdata(pdev);
|
struct lpass_data *drvdata = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
if (drvdata->variant->exit)
|
if (drvdata->variant->exit)
|
||||||
drvdata->variant->exit(pdev);
|
drvdata->variant->exit(pdev);
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_remove);
|
EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_remove);
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ static struct platform_driver ipq806x_lpass_cpu_platform_driver = {
|
|||||||
.of_match_table = of_match_ptr(ipq806x_lpass_cpu_device_id),
|
.of_match_table = of_match_ptr(ipq806x_lpass_cpu_device_id),
|
||||||
},
|
},
|
||||||
.probe = asoc_qcom_lpass_cpu_platform_probe,
|
.probe = asoc_qcom_lpass_cpu_platform_probe,
|
||||||
.remove = asoc_qcom_lpass_cpu_platform_remove,
|
.remove_new = asoc_qcom_lpass_cpu_platform_remove,
|
||||||
};
|
};
|
||||||
module_platform_driver(ipq806x_lpass_cpu_platform_driver);
|
module_platform_driver(ipq806x_lpass_cpu_platform_driver);
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ static struct platform_driver sc7180_lpass_cpu_platform_driver = {
|
|||||||
.pm = &sc7180_lpass_pm_ops,
|
.pm = &sc7180_lpass_pm_ops,
|
||||||
},
|
},
|
||||||
.probe = asoc_qcom_lpass_cpu_platform_probe,
|
.probe = asoc_qcom_lpass_cpu_platform_probe,
|
||||||
.remove = asoc_qcom_lpass_cpu_platform_remove,
|
.remove_new = asoc_qcom_lpass_cpu_platform_remove,
|
||||||
.shutdown = asoc_qcom_lpass_cpu_platform_shutdown,
|
.shutdown = asoc_qcom_lpass_cpu_platform_shutdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ static struct platform_driver sc7280_lpass_cpu_platform_driver = {
|
|||||||
.pm = &sc7280_lpass_pm_ops,
|
.pm = &sc7280_lpass_pm_ops,
|
||||||
},
|
},
|
||||||
.probe = asoc_qcom_lpass_cpu_platform_probe,
|
.probe = asoc_qcom_lpass_cpu_platform_probe,
|
||||||
.remove = asoc_qcom_lpass_cpu_platform_remove,
|
.remove_new = asoc_qcom_lpass_cpu_platform_remove,
|
||||||
.shutdown = asoc_qcom_lpass_cpu_platform_shutdown,
|
.shutdown = asoc_qcom_lpass_cpu_platform_shutdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ struct lpass_pcm_data {
|
|||||||
|
|
||||||
/* register the platform driver from the CPU DAI driver */
|
/* register the platform driver from the CPU DAI driver */
|
||||||
int asoc_qcom_lpass_platform_register(struct platform_device *);
|
int asoc_qcom_lpass_platform_register(struct platform_device *);
|
||||||
int asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev);
|
void asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev);
|
||||||
void asoc_qcom_lpass_cpu_platform_shutdown(struct platform_device *pdev);
|
void asoc_qcom_lpass_cpu_platform_shutdown(struct platform_device *pdev);
|
||||||
int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev);
|
int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev);
|
||||||
extern const struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops;
|
extern const struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops;
|
||||||
|
Loading…
Reference in New Issue
Block a user