diff mbox series

ASoC: SOF: loader: load_firmware callback is mandatory, treat it like that

Message ID 20210914125356.19828-1-peter.ujfalusi@linux.intel.com
State Accepted
Commit 96ec1741067dd73c6061c8f6ec1e9976aee5337b
Headers show
Series ASoC: SOF: loader: load_firmware callback is mandatory, treat it like that | expand

Commit Message

Peter Ujfalusi Sept. 14, 2021, 12:53 p.m. UTC
Since the load_firmware callback in snd_sof_dsp_ops is mandatory and it
is tested during probe.

Move the snd_sof_load_firmware() wrapper to ops.h as inline and drop the
check of sof_ops(sdev)->load_firmware

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/sof/loader.c   | 10 ----------
 sound/soc/sof/ops.h      |  8 ++++++++
 sound/soc/sof/sof-priv.h |  1 -
 3 files changed, 8 insertions(+), 11 deletions(-)

Comments

Mark Brown Sept. 15, 2021, 3:21 p.m. UTC | #1
On Tue, 14 Sep 2021 15:53:56 +0300, Peter Ujfalusi wrote:
> Since the load_firmware callback in snd_sof_dsp_ops is mandatory and it
> is tested during probe.
> 
> Move the snd_sof_load_firmware() wrapper to ops.h as inline and drop the
> check of sof_ops(sdev)->load_firmware
> 
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: loader: load_firmware callback is mandatory, treat it like that
      commit: 96ec1741067dd73c6061c8f6ec1e9976aee5337b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/sof/loader.c b/sound/soc/sof/loader.c
index 2b38a77cd594..5308c32e26fa 100644
--- a/sound/soc/sof/loader.c
+++ b/sound/soc/sof/loader.c
@@ -800,16 +800,6 @@  int snd_sof_load_firmware_memcpy(struct snd_sof_dev *sdev)
 }
 EXPORT_SYMBOL(snd_sof_load_firmware_memcpy);
 
-int snd_sof_load_firmware(struct snd_sof_dev *sdev)
-{
-	dev_dbg(sdev->dev, "loading firmware\n");
-
-	if (sof_ops(sdev)->load_firmware)
-		return sof_ops(sdev)->load_firmware(sdev);
-	return 0;
-}
-EXPORT_SYMBOL(snd_sof_load_firmware);
-
 int snd_sof_run_firmware(struct snd_sof_dev *sdev)
 {
 	int ret;
diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h
index 4a5d6e497f05..731b8157aaea 100644
--- a/sound/soc/sof/ops.h
+++ b/sound/soc/sof/ops.h
@@ -400,6 +400,14 @@  snd_sof_pcm_platform_trigger(struct snd_sof_dev *sdev,
 	return 0;
 }
 
+/* Firmware loading */
+static inline int snd_sof_load_firmware(struct snd_sof_dev *sdev)
+{
+	dev_dbg(sdev->dev, "loading firmware\n");
+
+	return sof_ops(sdev)->load_firmware(sdev);
+}
+
 /* host DSP message data */
 static inline void snd_sof_ipc_msg_data(struct snd_sof_dev *sdev,
 					struct snd_pcm_substream *substream,
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index fd8423172d8f..1adbcda0b364 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -485,7 +485,6 @@  int snd_sof_create_page_table(struct device *dev,
 /*
  * Firmware loading.
  */
-int snd_sof_load_firmware(struct snd_sof_dev *sdev);
 int snd_sof_load_firmware_raw(struct snd_sof_dev *sdev);
 int snd_sof_load_firmware_memcpy(struct snd_sof_dev *sdev);
 int snd_sof_run_firmware(struct snd_sof_dev *sdev);