From 4d577c42b47dfffda80da995fafd5b16fdb242e2 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Tue, 4 Feb 2025 13:18:45 +0000
Subject: [PATCH] mailbox: rp1: Don't claim channels in of_xlate

The of_xlate method saves the calculated event mask in the con_priv
field. It also rejects subsequent attempt to use that channel because
the mask is non-zero, which causes a repeated instantiation of a client
driver to fail.

The of_xlate method is not meant to be a point of resource acquisition.
Leave the con_priv initialisation, but drop the test that it was
previously zero.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
 drivers/mailbox/rp1-mailbox.c | 2 --
 1 file changed, 2 deletions(-)

--- a/drivers/mailbox/rp1-mailbox.c
+++ b/drivers/mailbox/rp1-mailbox.c
@@ -133,8 +133,6 @@ static struct mbox_chan *rp1_mbox_xlate(
 		return ERR_PTR(-EINVAL);
 
 	chan = &mbox->chans[doorbell];
-	if (chan->con_priv)
-		return ERR_PTR(-EBUSY);
 
 	chan->con_priv = (void *)(uintptr_t)(1 << doorbell);
 
