imx:mx6 fix return value of mxc_get_clock
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
@@ -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
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 unsupportedmxc_clocktype is passed tomxc_get_clock.Also include an err message when unsupported
mxc_clocktype is passed tomxc_get_clock.Signed-off-by Peng Fan <[email protected]>
PATCH 1/1 imx:mx6 fix return value of mxc_get_clock
In reply to Peng FanQuoted 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 unsupportedmxc_clocktype is passed tomxc_get_clock.Also include an err message when unsupported
mxc_clocktype is passed tomxc_get_clock.Signed-off-by Peng Fan <[email protected]>---
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 =====================================================================