Commit 54f391dd authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Vinod Koul
Browse files

soundwire: intel: simplify flow and use devm_ for DAI registration



We already use devm_ for memory allocation but not for component/DAI
registration. The resource management can be based on devm_ in all
cases.

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


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent c6867cda
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1203,7 +1203,7 @@ static int intel_register_dai(struct sdw_intel *sdw)
	if (ret)
		return ret;

	return snd_soc_register_component(cdns->dev, &dai_component,
	return devm_snd_soc_register_component(cdns->dev, &dai_component,
					       dais, num_dai);
}

@@ -1489,7 +1489,6 @@ int intel_link_startup(struct auxiliary_device *auxdev)

static void intel_link_remove(struct auxiliary_device *auxdev)
{
	struct device *dev = &auxdev->dev;
	struct sdw_cdns *cdns = auxiliary_get_drvdata(auxdev);
	struct sdw_intel *sdw = cdns_to_intel(cdns);
	struct sdw_bus *bus = &cdns->bus;
@@ -1502,7 +1501,6 @@ static void intel_link_remove(struct auxiliary_device *auxdev)
	if (!bus->prop.hw_disabled) {
		intel_debugfs_exit(sdw);
		sdw_cdns_enable_interrupt(cdns, false);
		snd_soc_unregister_component(dev);
	}
	sdw_bus_master_delete(bus);
}