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

Sanyog Kale sanyog.r.kale at intel.com
Tue Jul 10 18:37:55 CEST 2018


On Mon, Jul 09, 2018 at 06:22:26PM -0500, Pierre-Louis Bossart wrote:
> 
> >@@ -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?)

Agreed, this error check should be done upfront. Will fix this and
also the return value.

-- 


More information about the Alsa-devel mailing list