mailbox: qcom-ipcc: fix incorrect num_chans counting

[ Upstream commit a493208079 ]

Breaking out early when a match is found leads to an incorrect num_chans
value when more than one ipcc mailbox channel is used by the same device.

Fixes: e9d50e4b4d ("mailbox: qcom-ipcc: Dynamic alloc for channel arrangement")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Jonathan Marek 2023-08-02 09:52:22 -04:00 committed by Greg Kroah-Hartman
parent 1a1623087d
commit 30e4f88dfa
1 changed files with 1 additions and 3 deletions

View File

@ -227,10 +227,8 @@ static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc,
ret = of_parse_phandle_with_args(client_dn, "mboxes",
"#mbox-cells", j, &curr_ph);
of_node_put(curr_ph.np);
if (!ret && curr_ph.np == controller_dn) {
if (!ret && curr_ph.np == controller_dn)
ipcc->num_chans++;
break;
}
}
}