]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: qcom: lpass: Make asoc_qcom_lpass_cpu_platform_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 13 Oct 2023 22:19:52 +0000 (00:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:50:39 +0000 (07:50 +0200)
[ Upstream commit d0cc676c426d1958989fac2a0d45179fb9992f0a ]

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>
Stable-dep-of: a93dad6f4e6a ("ASoC: q6apm-dai: make use of q6apm_get_hw_pointer")
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/qcom/lpass-apq8016.c
sound/soc/qcom/lpass-cpu.c
sound/soc/qcom/lpass-ipq806x.c
sound/soc/qcom/lpass-sc7180.c
sound/soc/qcom/lpass-sc7280.c
sound/soc/qcom/lpass.h

index f919d46e18caa82c2b95eba4a9ebcf63bbe05101..06a4faae50875dafea0a4d3e9c8ce0779e7c4600 100644 (file)
@@ -300,7 +300,7 @@ static struct platform_driver apq8016_lpass_cpu_platform_driver = {
                .of_match_table = of_match_ptr(apq8016_lpass_cpu_device_id),
        },
        .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);
 
index e587455dc40a0efa46ac0fc7e5c0c528d2d0695e..92316768011ae5721881710d117d88d4f2de8ac6 100644 (file)
@@ -1284,15 +1284,12 @@ err:
 }
 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);
 
        if (drvdata->variant->exit)
                drvdata->variant->exit(pdev);
-
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_remove);
 
index 2c97f295e39400dc048f19c87140aa6f25a9a06c..10f7e2639c42372d563eede5b4566c883c9e4018 100644 (file)
@@ -172,7 +172,7 @@ static struct platform_driver ipq806x_lpass_cpu_platform_driver = {
                .of_match_table = of_match_ptr(ipq806x_lpass_cpu_device_id),
        },
        .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);
 
index d16c0d83aaad923890fe9d6994c12663947d40a0..62e49a0d27ba2354349998cfe97b94a585bd762d 100644 (file)
@@ -315,7 +315,7 @@ static struct platform_driver sc7180_lpass_cpu_platform_driver = {
                .pm = &sc7180_lpass_pm_ops,
        },
        .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,
 };
 
index 6b2eb25ed9390c012b7eca326dcc6ce70f4aa86a..97b9053ed3b027f7d3489099a6a50c98e3fa7971 100644 (file)
@@ -445,7 +445,7 @@ static struct platform_driver sc7280_lpass_cpu_platform_driver = {
                .pm = &sc7280_lpass_pm_ops,
        },
        .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,
 };
 
index ea12f02eca55f67206b1f6e4a56304742d02849d..f821271a114675103e73be6f4d1a9ee1fe6120e6 100644 (file)
@@ -400,7 +400,7 @@ struct lpass_pcm_data {
 
 /* register the platform driver from the CPU DAI driver */
 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);
 int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev);
 extern const struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops;