Patchwork [U-Boot,v2] Ethernut 5: fix build error

login
register
mail settings
Submitter prabhakar.csengg@gmail.com
Date Feb. 23, 2012, 11:53 a.m.
Message ID <1329998020-2338-1-git-send-email-prabhakar.csengg@gmail.com>
Download mbox | patch
Permalink /patch/142594/
State Accepted
Delegated to: Albert ARIBAUD
Headers show

Comments

prabhakar.csengg@gmail.com - Feb. 23, 2012, 11:53 a.m.
Fix build error for ethernut5 board due to prototype change
for function board_mmc_getcd().
ethernut5.c:238: error: conflicting types for 'board_mmc_getcd'
u-boot/include/mmc.h:318: note: previous declaration of 'board_mmc_getcd'
was here
make[2]: *** [ethernut5.o] Error 1

Signed-off-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: Tim Schendekehl <tim.schendekehl@egnite.de>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: egnite GmbH <info@egnite.de>
---
 Changes for v2:
  Description change.

 board/egnite/ethernut5/ethernut5.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
Albert ARIBAUD - Feb. 29, 2012, 12:07 a.m.
Hi Prabhakar,

Le 23/02/2012 12:53, Prabhakar Lad a écrit :
> Fix build error for ethernut5 board due to prototype change
> for function board_mmc_getcd().
> ethernut5.c:238: error: conflicting types for 'board_mmc_getcd'
> u-boot/include/mmc.h:318: note: previous declaration of 'board_mmc_getcd'
> was here
> make[2]: *** [ethernut5.o] Error 1
>
> Signed-off-by: Prabhakar Lad<prabhakar.csengg@gmail.com>
> Cc: Tim Schendekehl<tim.schendekehl@egnite.de>
> Cc: Thierry Reding<thierry.reding@avionic-design.de>
> Cc: Albert ARIBAUD<albert.u.boot@aribaud.net>
> Cc: egnite GmbH<info@egnite.de>
> ---
>   Changes for v2:
>    Description change.
>
>   board/egnite/ethernut5/ethernut5.c |    5 ++---
>   1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/board/egnite/ethernut5/ethernut5.c b/board/egnite/ethernut5/ethernut5.c
> index e42e91e..fd021a3 100644
> --- a/board/egnite/ethernut5/ethernut5.c
> +++ b/board/egnite/ethernut5/ethernut5.c
> @@ -235,10 +235,9 @@ int board_mmc_init(bd_t *bd)
>   	return atmel_mci_init((void *)ATMEL_BASE_MCI);
>   }
>
> -int board_mmc_getcd(u8 *cd, struct mmc *mmc)
> +int board_mmc_getcd(struct mmc *mmc)
>   {
> -	*cd = at91_get_pio_value(CONFIG_SYS_MMC_CD_PIN) ? 1 : 0;
> -	return 0;
> +	return !at91_get_pio_value(CONFIG_SYS_MMC_CD_PIN);
>   }
>   #endif

Applied to u-boot-arm/master as a bugfix, thanks!

Amicalement,

Patch

diff --git a/board/egnite/ethernut5/ethernut5.c b/board/egnite/ethernut5/ethernut5.c
index e42e91e..fd021a3 100644
--- a/board/egnite/ethernut5/ethernut5.c
+++ b/board/egnite/ethernut5/ethernut5.c
@@ -235,10 +235,9 @@  int board_mmc_init(bd_t *bd)
 	return atmel_mci_init((void *)ATMEL_BASE_MCI);
 }
 
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+int board_mmc_getcd(struct mmc *mmc)
 {
-	*cd = at91_get_pio_value(CONFIG_SYS_MMC_CD_PIN) ? 1 : 0;
-	return 0;
+	return !at91_get_pio_value(CONFIG_SYS_MMC_CD_PIN);
 }
 #endif