soundwire: stream: fix support for multiple Slaves on the same link
authorRander Wang <rander.wang@intel.com>
Tue, 14 Jan 2020 23:52:26 +0000 (17:52 -0600)
committerVinod Koul <vkoul@kernel.org>
Thu, 13 Feb 2020 10:27:37 +0000 (15:57 +0530)
The existing code will unconditionally return after dealing with the
first Slave on a link. This return should only happen when there is
an error case.

Tested on Comet Lake platform.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20200114235227.14502-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/stream.c

index c28ce7f..da10f38 100644 (file)
@@ -587,10 +587,11 @@ static int sdw_notify_config(struct sdw_master_runtime *m_rt)
 
                if (slave->ops->bus_config) {
                        ret = slave->ops->bus_config(slave, &bus->params);
-                       if (ret < 0)
+                       if (ret < 0) {
                                dev_err(bus->dev, "Notify Slave: %d failed\n",
                                        slave->dev_num);
-                       return ret;
+                               return ret;
+                       }
                }
        }