mailbox: qcom-ipcc: Support multiple channels for a given client

Message ID 20230223061318.1793-1-quic_hyiwei@quicinc.com
State New
Headers
Series mailbox: qcom-ipcc: Support multiple channels for a given client |

Commit Message

Huang Yiwei Feb. 23, 2023, 6:13 a.m. UTC
  Recently a new use case where two signals for the same protocol and
client is needed, that means there will be more than one channel
for a mbox node. Current driver only supports one channel, so need
to remove the limitation and let the driver find every channel
correctly.

Signed-off-by: Huang Yiwei <quic_hyiwei@quicinc.com>
---
 drivers/mailbox/qcom-ipcc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Guru Das Srinagesh Feb. 24, 2023, 3:27 a.m. UTC | #1
On Feb 23 2023 14:13, Huang Yiwei wrote:
> Recently a new use case where two signals for the same protocol and
> client is needed, that means there will be more than one channel
> for a mbox node. Current driver only supports one channel, so need
> to remove the limitation and let the driver find every channel
> correctly.
> 
> Signed-off-by: Huang Yiwei <quic_hyiwei@quicinc.com>
> ---
>  drivers/mailbox/qcom-ipcc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
> index 7e27acf6c0cc..367658af089e 100644
> --- a/drivers/mailbox/qcom-ipcc.c
> +++ b/drivers/mailbox/qcom-ipcc.c
> @@ -226,11 +226,9 @@ static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc,
>  		for (j = 0; j < i; j++) {
>  			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;
> -			}
> +			of_node_put(curr_ph.np);

of_node_put can stay where it is - the main change is the removal of the break,
is it not?

Guru Das.
  

Patch

diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
index 7e27acf6c0cc..367658af089e 100644
--- a/drivers/mailbox/qcom-ipcc.c
+++ b/drivers/mailbox/qcom-ipcc.c
@@ -226,11 +226,9 @@  static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc,
 		for (j = 0; j < i; j++) {
 			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;
-			}
+			of_node_put(curr_ph.np);
 		}
 	}