public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] imx:mx6 fix return value of mxc_get_clock
@ 2014-11-23  3:52 Peng Fan
  2014-11-24  0:38 ` Fabio Estevam
  2014-12-19  9:43 ` Stefano Babic
  0 siblings, 2 replies; 3+ messages in thread
From: Peng Fan @ 2014-11-23  3:52 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
---
 arch/arm/cpu/armv7/mx6/clock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index 80b11aa..99dba07 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -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;
 }
 
 /*
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] imx:mx6 fix return value of mxc_get_clock
  2014-11-23  3:52 [U-Boot] [PATCH] imx:mx6 fix return value of mxc_get_clock Peng Fan
@ 2014-11-24  0:38 ` Fabio Estevam
  2014-12-19  9:43 ` Stefano Babic
  1 sibling, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2014-11-24  0:38 UTC (permalink / raw)
  To: u-boot

On Sun, Nov 23, 2014 at 1:52 AM, Peng Fan <Peng.Fan@freescale.com> wrote:
> 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.
>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>

Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] imx:mx6 fix return value of mxc_get_clock
  2014-11-23  3:52 [U-Boot] [PATCH] imx:mx6 fix return value of mxc_get_clock Peng Fan
  2014-11-24  0:38 ` Fabio Estevam
@ 2014-12-19  9:43 ` Stefano Babic
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2014-12-19  9:43 UTC (permalink / raw)
  To: u-boot

On 23/11/2014 04:52, Peng Fan wrote:
> 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.
> 
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> ---


Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=====================================================================
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
=====================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-19  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-23  3:52 [U-Boot] [PATCH] imx:mx6 fix return value of mxc_get_clock Peng Fan
2014-11-24  0:38 ` Fabio Estevam
2014-12-19  9:43 ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox