mailbox: pcc: Use mbox_bind_client
authorElliot Berman <quic_eberman@quicinc.com>
Mon, 10 Apr 2023 16:16:54 +0000 (09:16 -0700)
committerJassi Brar <jaswinder.singh@linaro.org>
Tue, 18 Apr 2023 16:48:56 +0000 (11:48 -0500)
commit76d4adacd52e78bea2e393081f2a5766261d1e3a
treeeece415aecf285ebe9b14365deebc909df2c1f04
parentf11ff34d883a26f4f13c307aeb556f2b076a5066
mailbox: pcc: Use mbox_bind_client

Use generic mbox_bind_client() to bind omap mailbox channel to a client.

mbox_bind_client is identical to the replaced lines, except that it:
 - Does the operation under con_mutex which prevents possible races in
   removal path
 - Sets TXDONE_BY_ACK if pcc uses TXDONE_BY_POLL and the client knows
   when tx is done. TXDONE_BY_ACK is already set if there's no interrupt,
   so this is not applicable.
 - Calls chan->mbox->ops->startup. This is usecase for requesting irq:
   move the devm_request_irq into the startup callback and unregister it
   in the shutdown path.

Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/pcc.c