[U-Boot,1/2] imx: mx6sx: Fix issue in LCDIF clock enablement
diff mbox

Message ID 1453816918-25383-1-git-send-email-ye.li@nxp.com
State Accepted
Commit 9655ebdd50c42f24179d738e4e6230c048f41de1
Delegated to: Stefano Babic
Headers show

Commit Message

Ye Li Jan. 26, 2016, 2:01 p.m. UTC
Wrong checking for the base_addr paramter with LCDIF1 and LCDIF2. Always
enter the -EINVAL return.

Signed-off-by: Ye Li <ye.li@nxp.com>
---
 arch/arm/cpu/armv7/mx6/clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Babic Jan. 26, 2016, 2:11 p.m. UTC | #1
On 26/01/2016 15:01, Ye Li wrote:
> Wrong checking for the base_addr paramter with LCDIF1 and LCDIF2. Always
> enter the -EINVAL return.
> 
> Signed-off-by: Ye Li <ye.li@nxp.com>
> ---
>  arch/arm/cpu/armv7/mx6/clock.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index 27a3f2f..007204d 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -742,8 +742,8 @@ int enable_lcdif_clock(u32 base_addr)
>  	u32 lcdif_clk_sel_mask, lcdif_ccgr3_mask;
>  
>  	if (is_cpu_type(MXC_CPU_MX6SX)) {
> -		if ((base_addr == LCDIF1_BASE_ADDR) ||
> -		    (base_addr == LCDIF2_BASE_ADDR)) {
> +		if ((base_addr != LCDIF1_BASE_ADDR) &&
> +		    (base_addr != LCDIF2_BASE_ADDR)) {
>  			puts("Wrong LCD interface!\n");
>  			return -EINVAL;
>  		}
> 

Reviewed-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
Stefano Babic Feb. 2, 2016, 8:25 p.m. UTC | #2
On 26/01/2016 15:01, Ye Li wrote:
> Wrong checking for the base_addr paramter with LCDIF1 and LCDIF2. Always
> enter the -EINVAL return.
> 
> Signed-off-by: Ye Li <ye.li@nxp.com>
> ---
>  arch/arm/cpu/armv7/mx6/clock.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index 27a3f2f..007204d 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -742,8 +742,8 @@ int enable_lcdif_clock(u32 base_addr)
>  	u32 lcdif_clk_sel_mask, lcdif_ccgr3_mask;
>  
>  	if (is_cpu_type(MXC_CPU_MX6SX)) {
> -		if ((base_addr == LCDIF1_BASE_ADDR) ||
> -		    (base_addr == LCDIF2_BASE_ADDR)) {
> +		if ((base_addr != LCDIF1_BASE_ADDR) &&
> +		    (base_addr != LCDIF2_BASE_ADDR)) {
>  			puts("Wrong LCD interface!\n");
>  			return -EINVAL;
>  		}
> 
Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Patch
diff mbox

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index 27a3f2f..007204d 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -742,8 +742,8 @@  int enable_lcdif_clock(u32 base_addr)
 	u32 lcdif_clk_sel_mask, lcdif_ccgr3_mask;
 
 	if (is_cpu_type(MXC_CPU_MX6SX)) {
-		if ((base_addr == LCDIF1_BASE_ADDR) ||
-		    (base_addr == LCDIF2_BASE_ADDR)) {
+		if ((base_addr != LCDIF1_BASE_ADDR) &&
+		    (base_addr != LCDIF2_BASE_ADDR)) {
 			puts("Wrong LCD interface!\n");
 			return -EINVAL;
 		}