ASoC: SOF: sof-client: fix build when only IPC4 is selected
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 6 Oct 2023 08:40:41 +0000 (11:40 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 9 Oct 2023 12:14:17 +0000 (13:14 +0100)
When IPC3 is not selected, sof-client.c still makes a hard-coded
reference to an IPC3-specific function:

ERROR: modpost: "sof_ipc3_do_rx_work" [sound/soc/sof/snd-sof.ko]
undefined!

Fix by making the code conditional.

Closes: https://github.com/thesofproject/linux/issues/4581
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20231006084041.18100-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-client.c

index 3f636b82173e77df180eaf5694e556f9952f2373..9dce7f53b482131e5db23da720ca2f598dc32996 100644 (file)
@@ -305,7 +305,8 @@ EXPORT_SYMBOL_NS_GPL(sof_client_ipc_tx_message, SND_SOC_SOF_CLIENT);
 
 int sof_client_ipc_rx_message(struct sof_client_dev *cdev, void *ipc_msg, void *msg_buf)
 {
-       if (cdev->sdev->pdata->ipc_type == SOF_IPC_TYPE_3) {
+       if (IS_ENABLED(CONFIG_SND_SOC_SOF_IPC3) &&
+           cdev->sdev->pdata->ipc_type == SOF_IPC_TYPE_3) {
                struct sof_ipc_cmd_hdr *hdr = ipc_msg;
 
                if (hdr->size < sizeof(hdr)) {