Skip to content

Commit d0ae9dc

Browse files
wensbroonie
authored andcommitted
ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c
Commit 014fdeb ("ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c") caused a circular dependency between the snd_sof and snd_sof_of modules: depmod: ERROR: Cycle detected: snd_sof -> snd_sof_of -> snd_sof depmod: ERROR: Found 2 modules in dependency cycles! Move the function back with sof_machine_select(). Fixes: 014fdeb ("ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c") Signed-off-by: Chen-Yu Tsai <[email protected]> Acked-by: Peter Ujfalusi <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 4978d3f commit d0ae9dc

File tree

3 files changed

+22
-32
lines changed

3 files changed

+22
-32
lines changed

sound/soc/sof/core.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,28 @@ void sof_set_fw_state(struct snd_sof_dev *sdev, enum sof_fw_state new_state)
144144
}
145145
EXPORT_SYMBOL(sof_set_fw_state);
146146

147+
static struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev)
148+
{
149+
struct snd_sof_pdata *sof_pdata = sdev->pdata;
150+
const struct sof_dev_desc *desc = sof_pdata->desc;
151+
struct snd_sof_of_mach *mach = desc->of_machines;
152+
153+
if (!mach)
154+
return NULL;
155+
156+
for (; mach->compatible; mach++) {
157+
if (of_machine_is_compatible(mach->compatible)) {
158+
sof_pdata->tplg_filename = mach->sof_tplg_filename;
159+
if (mach->fw_filename)
160+
sof_pdata->fw_filename = mach->fw_filename;
161+
162+
return mach;
163+
}
164+
}
165+
166+
return NULL;
167+
}
168+
147169
/* SOF Driver enumeration */
148170
static int sof_machine_check(struct snd_sof_dev *sdev)
149171
{

sound/soc/sof/sof-of-dev.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,6 @@ static void sof_of_probe_complete(struct device *dev)
4141
pm_runtime_enable(dev);
4242
}
4343

44-
struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev)
45-
{
46-
struct snd_sof_pdata *sof_pdata = sdev->pdata;
47-
const struct sof_dev_desc *desc = sof_pdata->desc;
48-
struct snd_sof_of_mach *mach = desc->of_machines;
49-
50-
if (!mach)
51-
return NULL;
52-
53-
for (; mach->compatible; mach++) {
54-
if (of_machine_is_compatible(mach->compatible)) {
55-
sof_pdata->tplg_filename = mach->sof_tplg_filename;
56-
if (mach->fw_filename)
57-
sof_pdata->fw_filename = mach->fw_filename;
58-
59-
return mach;
60-
}
61-
}
62-
63-
return NULL;
64-
}
65-
EXPORT_SYMBOL(sof_of_machine_select);
66-
6744
int sof_of_probe(struct platform_device *pdev)
6845
{
6946
struct device *dev = &pdev->dev;

sound/soc/sof/sof-of-dev.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ struct snd_sof_of_mach {
1616
const char *sof_tplg_filename;
1717
};
1818

19-
#if IS_ENABLED(CONFIG_SND_SOC_SOF_OF_DEV)
20-
struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev);
21-
#else
22-
static inline struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev)
23-
{
24-
return NULL;
25-
}
26-
#endif
27-
2819
extern const struct dev_pm_ops sof_of_pm;
2920

3021
int sof_of_probe(struct platform_device *pdev);

0 commit comments

Comments
 (0)