Skip to contentSkip to conversation

imx-common: rdc-sema: correct return value

PATCH New Peng Fan 2 participants 2 messages Apr 21, 2017 – May 11, 2017

Subsystems (2)
lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 imx-common: rdc-sema: correct return value

When unlock, if caller is not the sema owner,
return -EACCES, not 1.

Cc Stefano Babic <[email protected]>
---
 arch/arm/imx-common/rdc-sema.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/imx-common/rdc-sema.c +1 -1
index 5df4e02..1d97ac8 100644
@@ -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]);
 
Signature · 1 line
2.6.2
#1 lore raw

PATCH 1/1 imx-common: rdc-sema: correct return value

Quoted 15 lines · Peng Fan

When unlock, if caller is not the sema owner,
return -EACCES, not 1.

Cc Stefano Babic <[email protected]>
---
 arch/arm/imx-common/rdc-sema.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/imx-common/rdc-sema.c +0 -0
index 5df4e02..1d97ac8 100644

arch/arm/imx-common/rdc-sema.c int imx_rdc_sema_unlock(int per_id) · line 100

Quoted 8 lines
arch/arm/imx-common/rdc-sema.c +1 -1
@@ -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]);
 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================