Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: Intel: start simplify the signature of link_slaves_found()

Start removing Intel-specific arguments to make that function usable
by other SOC vendors.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230731213242.434594-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Pierre-Louis Bossart and committed by
Mark Brown
799d9933 169e154b

+7 -12
+7 -12
sound/soc/sof/intel/hda.c
··· 1433 1433 SDW_MFG_ID_MASK | SDW_PART_ID_MASK)) 1434 1434 1435 1435 /* Check if all Slaves defined on the link can be found */ 1436 - static bool link_slaves_found(struct snd_sof_dev *sdev, 1436 + static bool link_slaves_found(struct device *dev, 1437 1437 const struct snd_soc_acpi_link_adr *link, 1438 - struct sdw_intel_ctx *sdw) 1438 + struct sdw_intel_slave_id *ids, 1439 + int num_slaves) 1439 1440 { 1440 - struct hdac_bus *bus = sof_to_bus(sdev); 1441 - struct sdw_intel_slave_id *ids = sdw->ids; 1442 - int num_slaves = sdw->num_slaves; 1443 1441 unsigned int part_id, link_id, unique_id, mfg_id, version; 1444 1442 int i, j, k; 1445 1443 ··· 1485 1487 unique_id = SDW_UNIQUE_ID(adr); 1486 1488 if (reported_part_count == 1 || 1487 1489 ids[j].id.unique_id == unique_id) { 1488 - dev_dbg(bus->dev, "found %x at link %d\n", 1489 - part_id, link_id); 1490 + dev_dbg(dev, "found %x at link %d\n", part_id, link_id); 1490 1491 break; 1491 1492 } 1492 1493 } else { 1493 - dev_dbg(bus->dev, "part %x reported %d expected %d on link %d, skipping\n", 1494 + dev_dbg(dev, "part %x reported %d expected %d on link %d, skipping\n", 1494 1495 part_id, reported_part_count, expected_part_count, link_id); 1495 1496 } 1496 1497 } 1497 1498 if (j == num_slaves) { 1498 - dev_dbg(bus->dev, 1499 - "Slave %x not found\n", 1500 - part_id); 1499 + dev_dbg(dev, "Slave %x not found\n", part_id); 1501 1500 return false; 1502 1501 } 1503 1502 } ··· 1544 1549 * Try next machine if any expected Slaves 1545 1550 * are not found on this link. 1546 1551 */ 1547 - if (!link_slaves_found(sdev, link, hdev->sdw)) 1552 + if (!link_slaves_found(sdev->dev, link, hdev->sdw->ids, hdev->sdw->num_slaves)) 1548 1553 break; 1549 1554 } 1550 1555 /* Found if all Slaves are checked */