* [PATCH] board: atmel: Fix compiler warning 'board_usb_hw_init()' not used
@ 2020-04-17 7:32 Josef Lusticky
2020-05-06 13:20 ` Eugen.Hristev at microchip.com
0 siblings, 1 reply; 2+ messages in thread
From: Josef Lusticky @ 2020-04-17 7:32 UTC (permalink / raw)
To: u-boot
Wrap definition of board_usb_hw_init() around with #ifdef CONFIG_CMD_USB
to avoid warning: 'board_usb_hw_init' defined but not used
[-Wunused-function] when compiling without CONFIG_CMD_USB.
This patch makes sama5d27_som1_ek, sama5d2_ptc_ek and sama5d2_xplained
consistent with other boards that use the same #ifdef to avoid the warning.
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Josef Lusticky <josef@lusticky.cz>
---
board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c | 2 ++
board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c | 2 ++
board/atmel/sama5d2_xplained/sama5d2_xplained.c | 2 ++
3 files changed, 6 insertions(+)
diff --git a/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c b/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c
index f3816c8334..376562cd0e 100644
--- a/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c
+++ b/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c
@@ -20,10 +20,12 @@ extern void at91_pda_detect(void);
DECLARE_GLOBAL_DATA_PTR;
+#ifdef CONFIG_CMD_USB
static void board_usb_hw_init(void)
{
atmel_pio4_set_pio_output(AT91_PIO_PORTA, 27, 1);
}
+#endif
#ifdef CONFIG_BOARD_LATE_INIT
int board_late_init(void)
diff --git a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c
index 4b3a703f26..b0a23b02db 100644
--- a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c
+++ b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c
@@ -76,10 +76,12 @@ int board_late_init(void)
}
#endif
+#ifdef CONFIG_CMD_USB
static void board_usb_hw_init(void)
{
atmel_pio4_set_pio_output(AT91_PIO_PORTB, 12, ATMEL_PIO_PUEN_MASK);
}
+#endif
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
static void board_uart0_hw_init(void)
diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c
index 2116b78837..01636fb73d 100644
--- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c
+++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c
@@ -20,10 +20,12 @@ extern void at91_pda_detect(void);
DECLARE_GLOBAL_DATA_PTR;
+#ifdef CONFIG_CMD_USB
static void board_usb_hw_init(void)
{
atmel_pio4_set_pio_output(AT91_PIO_PORTB, 10, 1);
}
+#endif
#ifdef CONFIG_BOARD_LATE_INIT
int board_late_init(void)
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH] board: atmel: Fix compiler warning 'board_usb_hw_init()' not used
2020-04-17 7:32 [PATCH] board: atmel: Fix compiler warning 'board_usb_hw_init()' not used Josef Lusticky
@ 2020-05-06 13:20 ` Eugen.Hristev at microchip.com
0 siblings, 0 replies; 2+ messages in thread
From: Eugen.Hristev at microchip.com @ 2020-05-06 13:20 UTC (permalink / raw)
To: u-boot
On 17.04.2020 10:32, Josef Lusticky wrote:
> Wrap definition of board_usb_hw_init() around with #ifdef CONFIG_CMD_USB
> to avoid warning: 'board_usb_hw_init' defined but not used
> [-Wunused-function] when compiling without CONFIG_CMD_USB.
>
> This patch makes sama5d27_som1_ek, sama5d2_ptc_ek and sama5d2_xplained
> consistent with other boards that use the same #ifdef to avoid the warning.
>
> Cc: Eugen Hristev <eugen.hristev@microchip.com>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Signed-off-by: Josef Lusticky <josef@lusticky.cz>
> ---
Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>
Applied to u-boot-atmel/master
Thanks !
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-06 13:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-17 7:32 [PATCH] board: atmel: Fix compiler warning 'board_usb_hw_init()' not used Josef Lusticky
2020-05-06 13:20 ` Eugen.Hristev at microchip.com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox