Re: [PATCH v5 8/9] soundwire: Add support for multi link bank switch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




@@ -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



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux