On 4/21/20 3:25 PM, Mateusz Gorski wrote:
Swap the order of machine device and platform device registration.
This change ensures that even if the codec enumeration falls late - during
the driver module or topology reload - i2s_dev field is always ready to
be used.
Are you sure?
The platform device will register the DAIs that are used by the machine
driver, don't you have a risk of missing dependencies during the card
registration with this change?
Put differently, why do this now when the existing code has been
'working' for a number of years without needing such a change?
Follow-up patch uses data from this field to create alternative topology
name based on used machine device.
Signed-off-by: Mateusz Gorski <mateusz.gorski@xxxxxxxxxxxxxxx>
---
sound/soc/intel/skylake/skl.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 63182bfd7941..8473eb13ea65 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -819,16 +819,16 @@ static void skl_probe_work(struct work_struct *work)
/* create codec instances */
skl_codec_create(bus);
- /* register platform dai and controls */
- err = skl_platform_register(bus->dev);
+ err = skl_machine_device_register(skl);
if (err < 0) {
- dev_err(bus->dev, "platform register failed: %d\n", err);
+ dev_err(bus->dev, "machine register failed: %d\n", err);
goto out_err;
}
- err = skl_machine_device_register(skl);
+ /* register platform dai and controls */
+ err = skl_platform_register(bus->dev);
if (err < 0) {
- dev_err(bus->dev, "machine register failed: %d\n", err);
+ dev_err(bus->dev, "platform register failed: %d\n", err);
goto out_err;
}