Skip to content

Commit 6d33c94

Browse files
committed
drivers: mbox_nxp_imx_mu: change send to return negative 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: mjchen0 <[email protected]>
1 parent 53c79c6 commit 6d33c94

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/mbox/mbox_nxp_imx_mu.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ static int nxp_imx_mu_send(const struct device *dev, uint32_t channel, const str
6161

6262
/* Signalling mode. */
6363
if (msg == NULL) {
64-
return MU_TriggerInterrupts(cfg->base, g_gen_int_trig_mask[channel]);
64+
int ret = MU_TriggerInterrupts(cfg->base, g_gen_int_trig_mask[channel]);
65+
if (ret != 0) {
66+
/* interrupt already pending, cannot trigger again */
67+
return -EAGAIN;
68+
}
69+
return ret;
6570
}
6671

6772
/* Data transfer mode. */

0 commit comments

Comments
 (0)