Skip to content

Commit c5ed9c5

Browse files
gustawbroonie
authored andcommitted
ASoC: Intel: Skylake: Fix passing loadable flag for module
skl_get_module_info() tries to set mconfig->module->loadable before mconfig->module has been assigned thus flag was always set to false and driver did not try to load module binaries. Signed-off-by: Gustaw Lewandowski <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Tested-by: Lukasz Majczak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e4e0633 commit c5ed9c5

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

sound/soc/intel/skylake/skl-pcm.c

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,21 +1310,6 @@ static int skl_get_module_info(struct skl_dev *skl,
13101310
return -EIO;
13111311
}
13121312

1313-
list_for_each_entry(module, &skl->uuid_list, list) {
1314-
if (guid_equal(uuid_mod, &module->uuid)) {
1315-
mconfig->id.module_id = module->id;
1316-
if (mconfig->module)
1317-
mconfig->module->loadable = module->is_loadable;
1318-
ret = 0;
1319-
break;
1320-
}
1321-
}
1322-
1323-
if (ret)
1324-
return ret;
1325-
1326-
uuid_mod = &module->uuid;
1327-
ret = -EIO;
13281313
for (i = 0; i < skl->nr_modules; i++) {
13291314
skl_module = skl->modules[i];
13301315
uuid_tplg = &skl_module->uuid;
@@ -1334,10 +1319,18 @@ static int skl_get_module_info(struct skl_dev *skl,
13341319
break;
13351320
}
13361321
}
1322+
13371323
if (skl->nr_modules && ret)
13381324
return ret;
13391325

1326+
ret = -EIO;
13401327
list_for_each_entry(module, &skl->uuid_list, list) {
1328+
if (guid_equal(uuid_mod, &module->uuid)) {
1329+
mconfig->id.module_id = module->id;
1330+
mconfig->module->loadable = module->is_loadable;
1331+
ret = 0;
1332+
}
1333+
13411334
for (i = 0; i < MAX_IN_QUEUE; i++) {
13421335
pin_id = &mconfig->m_in_pin[i].id;
13431336
if (guid_equal(&pin_id->mod_uuid, &module->uuid))
@@ -1351,7 +1344,7 @@ static int skl_get_module_info(struct skl_dev *skl,
13511344
}
13521345
}
13531346

1354-
return 0;
1347+
return ret;
13551348
}
13561349

13571350
static int skl_populate_modules(struct skl_dev *skl)

0 commit comments

Comments
 (0)