Commit 5c68b66d authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Vinod Koul
Browse files

soundwire: qcom: drop unneeded qcom_swrm_stream_alloc_ports() cleanup



The cleanup in "err" goto label clears bits from pconfig array which is
a local variable.  This does not have any effect outside of this
function, so drop this useless code.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231120190740.339350-1-krzysztof.kozlowski@linaro.org


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent b85ea95d
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -1157,7 +1157,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
	struct sdw_port_runtime *p_rt;
	struct sdw_slave *slave;
	unsigned long *port_mask;
	int i, maxport, pn, nports = 0, ret = 0;
	int maxport, pn, nports = 0, ret = 0;
	unsigned int m_port;

	mutex_lock(&ctrl->port_lock);
@@ -1183,7 +1183,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
				if (pn > maxport) {
					dev_err(ctrl->dev, "All ports busy\n");
					ret = -EBUSY;
					goto err;
					goto out;
				}
				set_bit(pn, port_mask);
				pconfig[nports].num = pn;
@@ -1205,12 +1205,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
	sconfig.bps = 1;
	sdw_stream_add_master(&ctrl->bus, &sconfig, pconfig,
			      nports, stream);
err:
	if (ret) {
		for (i = 0; i < nports; i++)
			clear_bit(pconfig[i].num, port_mask);
	}

out:
	mutex_unlock(&ctrl->port_lock);

	return ret;