]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: SOF: core: Move probe work related code under a single if () branch
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 16 Sep 2021 12:49:02 +0000 (15:49 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 16 Sep 2021 13:05:24 +0000 (14:05 +0100)
Relocate the INIT_WORK() at the same place where we schedule the work to
make the code simpler and easier to follow.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210916124902.24248-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/core.c

index 6be4f159ee358e9dd3c237053fe8d3d26eb1648b..9cbf7d72ae9224db3be8a079b7cabe86d31c4caf 100644 (file)
@@ -325,9 +325,6 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
        spin_lock_init(&sdev->hw_lock);
        mutex_init(&sdev->power_state_access);
 
-       if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
-               INIT_WORK(&sdev->probe_work, sof_probe_work);
-
        /* set default timeouts if none provided */
        if (plat_data->desc->ipc_timeout == 0)
                sdev->ipc_timeout = TIMEOUT_DEFAULT_IPC_MS;
@@ -339,6 +336,7 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
                sdev->boot_timeout = plat_data->desc->boot_timeout;
 
        if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)) {
+               INIT_WORK(&sdev->probe_work, sof_probe_work);
                schedule_work(&sdev->probe_work);
                return 0;
        }