Skip to contentSkip to conversation

imx:mx6 fix return value of mxc_get_clock

PATCH New Peng Fan 3 participants 3 messages Nov 23, 2014 – Dec 19, 2014 Arm (32-bit)

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 imx:mx6 fix return value of mxc_get_clock

mxc_get_clock's return type is unsigned int. 'return -1' is same with 'return 0xffffffff', so 0 should be used as the return value when unsupported mxc_clock type is passed to mxc_get_clock.

Also include an err message when unsupported mxc_clock type is passed to mxc_get_clock.

---
 arch/arm/cpu/armv7/mx6/clock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/cpu/armv7/mx6/clock.c +2 -1
index 80b11aa..99dba07 100644
@@ -738,10 +738,11 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
 	case MXC_SATA_CLK:
 		return get_ahb_clk();
 	default:
+		printf("Unsupported MXC CLK: %d\n", clk);
 		break;
 	}
 
-	return -1;
+	return 0;
 }
 
 /*
Signature · 1 line
1.8.4
#1 lore raw

PATCH 1/1 imx:mx6 fix return value of mxc_get_clock

Quoted 8 lines · Peng Fan

mxc_get_clock's return type is unsigned int. 'return -1' is same with 'return 0xffffffff', so 0 should be used as the return value when unsupported mxc_clock type is passed to mxc_get_clock.

Also include an err message when unsupported mxc_clock type is passed to mxc_get_clock.

#2 lore raw

PATCH 1/1 imx:mx6 fix return value of mxc_get_clock

In reply to Peng Fan
Quoted 9 lines · Peng Fan

mxc_get_clock's return type is unsigned int. 'return -1' is same with 'return 0xffffffff', so 0 should be used as the return value when unsupported mxc_clock type is passed to mxc_get_clock.

Also include an err message when unsupported mxc_clock type is passed to mxc_get_clock.

---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================