diff mbox

[U-Boot,1/3] imx: mx6 remove duplicated enable_cspi_clock

Message ID 1435142674-30212-1-git-send-email-Peng.Fan@freescale.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Peng Fan June 24, 2015, 10:44 a.m. UTC
enable_spi_clock does the same thing with enable_cspi_clock.

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

Comments

Fabio Estevam June 24, 2015, 3:53 p.m. UTC | #1
On Wed, Jun 24, 2015 at 7:44 AM, Peng Fan <Peng.Fan@freescale.com> wrote:
> enable_spi_clock does the same thing with enable_cspi_clock.
>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> ---
>  arch/arm/cpu/armv7/mx6/clock.c | 19 -------------------
>  1 file changed, 19 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index ae99945..1134770 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -102,25 +102,6 @@ void enable_uart_clk(unsigned char enable)
>  }
>  #endif
>
> -#ifdef CONFIG_SPI
> -/* spi_num can be from 0 - 4 */
> -int enable_cspi_clock(unsigned char enable, unsigned spi_num)
> -{
> -       u32 mask;
> -
> -       if (spi_num > 4)
> -               return -EINVAL;
> -
> -       mask = MXC_CCM_CCGR_CG_MASK << (spi_num * 2);
> -       if (enable)
> -               setbits_le32(&imx_ccm->CCGR1, mask);
> -       else
> -               clrbits_le32(&imx_ccm->CCGR1, mask);
> -
> -       return 0;
> -}
> -#endif
> -

This patch causes board/compulab/cm_fx6/spl.c to fail to build.

I see that you fix board/compulab/cm_fx6/spl.c in a later patch in
your series, but it should be part of the same patch to avoid the
build breakage.

You should also remove the function prototype from
arch/arm/include/asm/arch-mx6/clock.h.

Regards,

Fabio Estevam
Peng Fan June 25, 2015, 1:10 a.m. UTC | #2
On Wed, Jun 24, 2015 at 12:53:40PM -0300, Fabio Estevam wrote:
>On Wed, Jun 24, 2015 at 7:44 AM, Peng Fan <Peng.Fan@freescale.com> wrote:
>> enable_spi_clock does the same thing with enable_cspi_clock.
>>
>> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
>> ---
>>  arch/arm/cpu/armv7/mx6/clock.c | 19 -------------------
>>  1 file changed, 19 deletions(-)
>>
>> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
>> index ae99945..1134770 100644
>> --- a/arch/arm/cpu/armv7/mx6/clock.c
>> +++ b/arch/arm/cpu/armv7/mx6/clock.c
>> @@ -102,25 +102,6 @@ void enable_uart_clk(unsigned char enable)
>>  }
>>  #endif
>>
>> -#ifdef CONFIG_SPI
>> -/* spi_num can be from 0 - 4 */
>> -int enable_cspi_clock(unsigned char enable, unsigned spi_num)
>> -{
>> -       u32 mask;
>> -
>> -       if (spi_num > 4)
>> -               return -EINVAL;
>> -
>> -       mask = MXC_CCM_CCGR_CG_MASK << (spi_num * 2);
>> -       if (enable)
>> -               setbits_le32(&imx_ccm->CCGR1, mask);
>> -       else
>> -               clrbits_le32(&imx_ccm->CCGR1, mask);
>> -
>> -       return 0;
>> -}
>> -#endif
>> -
>
>This patch causes board/compulab/cm_fx6/spl.c to fail to build.
>
>I see that you fix board/compulab/cm_fx6/spl.c in a later patch in
>your series, but it should be part of the same patch to avoid the
>build breakage.
>
I thought board and arch code should not be in one patch,
so I splitted it into two patch. Will fix it in v2.
>You should also remove the function prototype from
>arch/arm/include/asm/arch-mx6/clock.h.
Thanks for pointing this out. Will fix in v2.
>
>Regards,
>
>Fabio Estevam

Thanks,
Peng
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index ae99945..1134770 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -102,25 +102,6 @@  void enable_uart_clk(unsigned char enable)
 }
 #endif
 
-#ifdef CONFIG_SPI
-/* spi_num can be from 0 - 4 */
-int enable_cspi_clock(unsigned char enable, unsigned spi_num)
-{
-	u32 mask;
-
-	if (spi_num > 4)
-		return -EINVAL;
-
-	mask = MXC_CCM_CCGR_CG_MASK << (spi_num * 2);
-	if (enable)
-		setbits_le32(&imx_ccm->CCGR1, mask);
-	else
-		clrbits_le32(&imx_ccm->CCGR1, mask);
-
-	return 0;
-}
-#endif
-
 #ifdef CONFIG_MMC
 int enable_usdhc_clk(unsigned char enable, unsigned bus_num)
 {