ASoC: SOF: make .remove callback return void
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 12 Oct 2023 19:18:50 +0000 (15:18 -0400)
committerMark Brown <broonie@kernel.org>
Thu, 12 Oct 2023 19:28:12 +0000 (20:28 +0100)
We don't use the returned value and return 0 anyways, let's follow the
example of platform drivers and simplify the definitions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20231012191850.147140-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 files changed:
sound/soc/sof/amd/acp.c
sound/soc/sof/amd/acp.h
sound/soc/sof/imx/imx8.c
sound/soc/sof/imx/imx8m.c
sound/soc/sof/imx/imx8ulp.c
sound/soc/sof/intel/byt.c
sound/soc/sof/intel/hda.c
sound/soc/sof/intel/hda.h
sound/soc/sof/mediatek/mt8186/mt8186.c
sound/soc/sof/mediatek/mt8195/mt8195.c
sound/soc/sof/ops.h
sound/soc/sof/sof-priv.h

index 19a8019..603ea5f 100644 (file)
@@ -575,7 +575,7 @@ unregister_dev:
 }
 EXPORT_SYMBOL_NS(amd_sof_acp_probe, SND_SOC_SOF_AMD_COMMON);
 
-int amd_sof_acp_remove(struct snd_sof_dev *sdev)
+void amd_sof_acp_remove(struct snd_sof_dev *sdev)
 {
        struct acp_dev_data *adata = sdev->pdata->hw_pdata;
 
@@ -588,7 +588,7 @@ int amd_sof_acp_remove(struct snd_sof_dev *sdev)
        if (adata->dmic_dev)
                platform_device_unregister(adata->dmic_dev);
 
-       return acp_reset(sdev);
+       acp_reset(sdev);
 }
 EXPORT_SYMBOL_NS(amd_sof_acp_remove, SND_SOC_SOF_AMD_COMMON);
 
index 4dcceb7..6814f20 100644 (file)
@@ -220,7 +220,7 @@ int configure_and_run_sha_dma(struct acp_dev_data *adata, void *image_addr,
 
 /* ACP device probe/remove */
 int amd_sof_acp_probe(struct snd_sof_dev *sdev);
-int amd_sof_acp_remove(struct snd_sof_dev *sdev);
+void amd_sof_acp_remove(struct snd_sof_dev *sdev);
 
 /* DSP Loader callbacks */
 int acp_sof_dsp_run(struct snd_sof_dev *sdev);
index e375f29..170740b 100644 (file)
@@ -338,7 +338,7 @@ exit_unroll_pm:
        return ret;
 }
 
-static int imx8_remove(struct snd_sof_dev *sdev)
+static void imx8_remove(struct snd_sof_dev *sdev)
 {
        struct imx8_priv *priv = sdev->pdata->hw_pdata;
        int i;
@@ -350,8 +350,6 @@ static int imx8_remove(struct snd_sof_dev *sdev)
                device_link_del(priv->link[i]);
                dev_pm_domain_detach(priv->pd_dev[i], false);
        }
-
-       return 0;
 }
 
 /* on i.MX8 there is 1 to 1 match between type and BAR idx */
index 198a9cd..2680f06 100644 (file)
@@ -269,14 +269,12 @@ exit_pdev_unregister:
        return ret;
 }
 
-static int imx8m_remove(struct snd_sof_dev *sdev)
+static void imx8m_remove(struct snd_sof_dev *sdev)
 {
        struct imx8m_priv *priv = sdev->pdata->hw_pdata;
 
        imx8_disable_clocks(sdev, priv->clks);
        platform_device_unregister(priv->ipc_dev);
-
-       return 0;
 }
 
 /* on i.MX8 there is 1 to 1 match between type and BAR idx */
index c046019..ca6edb8 100644 (file)
@@ -278,14 +278,12 @@ exit_pdev_unregister:
        return ret;
 }
 
-static int imx8ulp_remove(struct snd_sof_dev *sdev)
+static void imx8ulp_remove(struct snd_sof_dev *sdev)
 {
        struct imx8ulp_priv *priv = sdev->pdata->hw_pdata;
 
        imx8_disable_clocks(sdev, priv->clks);
        platform_device_unregister(priv->ipc_dev);
-
-       return 0;
 }
 
 /* on i.MX8 there is 1 to 1 match between type and BAR idx */
index 82ab4b0..373527b 100644 (file)
@@ -100,11 +100,9 @@ static int byt_resume(struct snd_sof_dev *sdev)
        return 0;
 }
 
-static int byt_remove(struct snd_sof_dev *sdev)
+static void byt_remove(struct snd_sof_dev *sdev)
 {
        byt_reset_dsp_disable_int(sdev);
-
-       return 0;
 }
 
 static int byt_acpi_probe(struct snd_sof_dev *sdev)
index a1732af..29f4e04 100644 (file)
@@ -1317,7 +1317,7 @@ err:
        return ret;
 }
 
-int hda_dsp_remove(struct snd_sof_dev *sdev)
+void hda_dsp_remove(struct snd_sof_dev *sdev)
 {
        struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
        const struct sof_intel_dsp_desc *chip = hda->desc;
@@ -1377,8 +1377,6 @@ skip_disable_dsp:
        sof_hda_bus_exit(sdev);
 
        hda_codec_i915_exit(sdev);
-
-       return 0;
 }
 
 int hda_power_down_dsp(struct snd_sof_dev *sdev)
index 7c575ba..0ebc042 100644 (file)
@@ -577,7 +577,7 @@ struct sof_intel_hda_stream {
  * DSP Core services.
  */
 int hda_dsp_probe(struct snd_sof_dev *sdev);
-int hda_dsp_remove(struct snd_sof_dev *sdev);
+void hda_dsp_remove(struct snd_sof_dev *sdev);
 int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask);
 int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask);
 int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask);
index 3717fde..b69fa78 100644 (file)
@@ -391,7 +391,7 @@ err_adsp_off:
        return ret;
 }
 
-static int mt8186_dsp_remove(struct snd_sof_dev *sdev)
+static void mt8186_dsp_remove(struct snd_sof_dev *sdev)
 {
        struct adsp_priv *priv = sdev->pdata->hw_pdata;
 
@@ -399,8 +399,6 @@ static int mt8186_dsp_remove(struct snd_sof_dev *sdev)
        mt8186_sof_hifixdsp_shutdown(sdev);
        adsp_sram_power_off(sdev);
        mt8186_adsp_clock_off(sdev);
-
-       return 0;
 }
 
 static int mt8186_dsp_shutdown(struct snd_sof_dev *sdev)
index b873e15..cac0a08 100644 (file)
@@ -388,7 +388,7 @@ static int mt8195_dsp_shutdown(struct snd_sof_dev *sdev)
        return snd_sof_suspend(sdev->dev);
 }
 
-static int mt8195_dsp_remove(struct snd_sof_dev *sdev)
+static void mt8195_dsp_remove(struct snd_sof_dev *sdev)
 {
        struct platform_device *pdev = container_of(sdev->dev, struct platform_device, dev);
        struct adsp_priv *priv = sdev->pdata->hw_pdata;
@@ -396,8 +396,6 @@ static int mt8195_dsp_remove(struct snd_sof_dev *sdev)
        platform_device_unregister(priv->ipc_dev);
        adsp_sram_power_on(&pdev->dev, false);
        adsp_clock_off(sdev);
-
-       return 0;
 }
 
 static int mt8195_dsp_suspend(struct snd_sof_dev *sdev, u32 target_state)
index a494bde..5be1cf8 100644 (file)
@@ -43,12 +43,10 @@ static inline int snd_sof_probe(struct snd_sof_dev *sdev)
        return sof_ops(sdev)->probe(sdev);
 }
 
-static inline int snd_sof_remove(struct snd_sof_dev *sdev)
+static inline void snd_sof_remove(struct snd_sof_dev *sdev)
 {
        if (sof_ops(sdev)->remove)
-               return sof_ops(sdev)->remove(sdev);
-
-       return 0;
+               sof_ops(sdev)->remove(sdev);
 }
 
 static inline int snd_sof_shutdown(struct snd_sof_dev *sdev)
index d4f6702..40bca5f 100644 (file)
@@ -166,7 +166,7 @@ struct snd_sof_dsp_ops {
 
        /* probe/remove/shutdown */
        int (*probe)(struct snd_sof_dev *sof_dev); /* mandatory */
-       int (*remove)(struct snd_sof_dev *sof_dev); /* optional */
+       void (*remove)(struct snd_sof_dev *sof_dev); /* optional */
        int (*shutdown)(struct snd_sof_dev *sof_dev); /* optional */
 
        /* DSP core boot / reset */