soundwire: intel: move to auxiliary bus
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 11 May 2021 05:21:32 +0000 (13:21 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 14 Jun 2021 04:42:26 +0000 (10:12 +0530)
commit29a269c6f54825c643a5c35762a2829ba5be67f6
treee722b054014a87005cc2d3fe0fd60d5c357b68f4
parent1ec9d2e7936c677a177916dab4b2bf26afbe2bed
soundwire: intel: move to auxiliary bus

Now that the auxiliary_bus exists, there's no reason to use platform
devices as children of a PCI device any longer.

This patch refactors the code by extending a basic auxiliary device
with Intel link-specific structures that need to be passed between
controller and link levels. This refactoring is much cleaner with no
need for cross-pointers between device and link structures.

Note that the auxiliary bus API has separate init and add steps, which
requires more attention in the error unwinding paths. The main loop
needs to deal with kfree() and auxiliary_device_uninit() for the
current iteration before jumping to the common label which releases
everything allocated in prior iterations.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210511052132.28150-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/Kconfig
drivers/soundwire/intel.c
drivers/soundwire/intel.h
drivers/soundwire/intel_init.c
include/linux/soundwire/sdw_intel.h