drivers: mbox_nxp_imx_mu: return negative errno value on error

Change nxp_imx_mu_send() to return a negative errno value
on error.

The fsl_mu function MU_TriggerInterrupts() returns either
kStatus_Success or kStatus_Fail, which have the value 0
or 1, respectively. kStatus_Fail should not be returned
to the upper levels, which expect negative values for
errors, so add a check for the return value of
MU_TriggerInterrupts() and return an errno value on error.

Signed-off-by: Mike J. Chen <mjchen@google.com>
This commit is contained in:
Mike J. Chen 2025-05-29 17:31:03 -07:00 committed by Benjamin Cabé
commit 27975075a5

View file

@ -61,7 +61,12 @@ static int nxp_imx_mu_send(const struct device *dev, uint32_t channel, const str
/* Signalling mode. */
if (msg == NULL) {
return MU_TriggerInterrupts(cfg->base, g_gen_int_trig_mask[channel]);
if (MU_TriggerInterrupts(cfg->base, g_gen_int_trig_mask[channel]) !=
kStatus_Success) {
/* interrupt already pending, cannot trigger again */
return -EAGAIN;
}
return 0;
}
/* Data transfer mode. */