Unverified Commit 5d4788b2 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

ASoC: SOF: Intel: hda: simplify and reduce indentation for hda_sdw_machine_select()



Simplify code to return when no links are enabled. No functional
change, just code cleanup before updates.

Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20240426153902.39560-4-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 490e6c9b
Loading
Loading
Loading
Loading
+73 −70
Original line number Diff line number Diff line
@@ -1653,13 +1653,17 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
	hdev = pdata->hw_pdata;
	link_mask = hdev->info.link_mask;

	if (!link_mask) {
		dev_info(sdev->dev, "SoundWire links not enabled\n");
		return NULL;
	}

	/*
	 * Select SoundWire machine driver if needed using the
	 * alternate tables. This case deals with SoundWire-only
	 * machines, for mixed cases with I2C/I2S the detection relies
	 * on the HID list.
	 */
	if (link_mask) {
	for (mach = pdata->desc->alt_machines;
	     mach && mach->link_mask; mach++) {
		/*
@@ -1737,7 +1741,6 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
	}

	dev_info(sdev->dev, "No SoundWire machine driver found\n");
	}

	return NULL;
}