struct sdw_port_runtime *p_rt;
struct sdw_slave *slave;
unsigned long *port_mask;
- int maxport, pn, nports = 0, ret = 0;
+ int maxport, pn, nports = 0;
unsigned int m_port;
struct sdw_port_config *pconfig __free(kfree) = kcalloc(ctrl->nports,
sizeof(*pconfig), GFP_KERNEL);
sconfig.type = stream->type;
sconfig.bps = 1;
- mutex_lock(&ctrl->port_lock);
+ guard(mutex)(&ctrl->port_lock);
+
list_for_each_entry(m_rt, &stream->master_list, stream_node) {
/*
* For streams with multiple masters:
if (pn > maxport) {
dev_err(ctrl->dev, "All ports busy\n");
- ret = -EBUSY;
- goto out;
+ return -EBUSY;
}
set_bit(pn, port_mask);
pconfig[nports].num = pn;
sdw_stream_add_master(&ctrl->bus, &sconfig, pconfig,
nports, stream);
-out:
- mutex_unlock(&ctrl->port_lock);
- return ret;
+ return 0;
}
static int qcom_swrm_hw_params(struct snd_pcm_substream *substream,