Skip to content

Commit 5c68b66

Browse files
krzkvinodkoul
authored andcommitted
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: Krzysztof Kozlowski <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent b85ea95 commit 5c68b66

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/soundwire/qcom.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
11571157
struct sdw_port_runtime *p_rt;
11581158
struct sdw_slave *slave;
11591159
unsigned long *port_mask;
1160-
int i, maxport, pn, nports = 0, ret = 0;
1160+
int maxport, pn, nports = 0, ret = 0;
11611161
unsigned int m_port;
11621162

11631163
mutex_lock(&ctrl->port_lock);
@@ -1183,7 +1183,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
11831183
if (pn > maxport) {
11841184
dev_err(ctrl->dev, "All ports busy\n");
11851185
ret = -EBUSY;
1186-
goto err;
1186+
goto out;
11871187
}
11881188
set_bit(pn, port_mask);
11891189
pconfig[nports].num = pn;
@@ -1205,12 +1205,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
12051205
sconfig.bps = 1;
12061206
sdw_stream_add_master(&ctrl->bus, &sconfig, pconfig,
12071207
nports, stream);
1208-
err:
1209-
if (ret) {
1210-
for (i = 0; i < nports; i++)
1211-
clear_bit(pconfig[i].num, port_mask);
1212-
}
1213-
1208+
out:
12141209
mutex_unlock(&ctrl->port_lock);
12151210

12161211
return ret;

0 commit comments

Comments
 (0)