summaryrefslogtreecommitdiff
path: root/arch/arm/imx-common/rdc-sema.c
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2017-04-21 08:56:50 (GMT)
committerStefano Babic <sbabic@denx.de>2017-05-18 09:23:31 (GMT)
commit354fa867103bb22a36371a90664a072c9aa71db7 (patch)
treea97e85124bc5752ae590905882f21440743d2ac4 /arch/arm/imx-common/rdc-sema.c
parent80512547ba3706679a039ae823bb957af422580e (diff)
downloadu-boot-354fa867103bb22a36371a90664a072c9aa71db7.tar.xz
imx-common: rdc-sema: correct return value
When unlock, if caller is not the sema owner, return -EACCES, not 1. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'arch/arm/imx-common/rdc-sema.c')
-rw-r--r--arch/arm/imx-common/rdc-sema.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/imx-common/rdc-sema.c b/arch/arm/imx-common/rdc-sema.c
index 5df4e02..1d97ac8 100644
--- a/arch/arm/imx-common/rdc-sema.c
+++ b/arch/arm/imx-common/rdc-sema.c
@@ -94,7 +94,7 @@ int imx_rdc_sema_unlock(int per_id)
reg = readb(&imx_rdc_sema->gate[per_id % SEMA_GATES_NUM]);
if ((reg & RDC_SEMA_GATE_GTFSM_MASK) != RDC_SEMA_PROC_ID)
- return 1; /*Not the semaphore owner */
+ return -EACCES; /*Not the semaphore owner */
writeb(0x0, &imx_rdc_sema->gate[per_id % SEMA_GATES_NUM]);