@@ -1170,6 +1276,17 @@ int sdw_stream_add_master(struct sdw_bus *bus,
stream->m_rt_count++;
+ /*
+ * For multi link streams, add the second master only if
+ * the bus supports it.
+ * Check if bus->multi_link is set
+ */
+ if (!bus->multi_link && stream->m_rt_count > 1) {
+ dev_err(bus->dev,
+ "Multilink not supported, link %d", bus->link_id);
+ goto stream_error;
+ }
+
goto unlock;
stream_error:
This error handling is a bit weird. It's make more sense to check
upfront if there is already one m_rt allocated (m_rt_count > 0) and bail
to avoid allocating/releasing a stream. Also there should be a return
value set (-EINVAL?)
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel