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:
parent
b28e1e122c
commit
27975075a5
1 changed files with 6 additions and 1 deletions
|
@ -61,7 +61,12 @@ static int nxp_imx_mu_send(const struct device *dev, uint32_t channel, const str
|
||||||
|
|
||||||
/* Signalling mode. */
|
/* Signalling mode. */
|
||||||
if (msg == NULL) {
|
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. */
|
/* Data transfer mode. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue