summaryrefslogtreecommitdiff
path: root/board/st
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2020-07-31 17:31:44 +0300
committerPatrice Chotard <patrice.chotard@st.com>2020-08-13 10:52:49 +0300
commitfeb6179ffefa455e8c88a9612528419b49c408a0 (patch)
tree7580bc4c6ad2deec489de6a35b2b34306f8aaf22 /board/st
parent6a8713bbe3268060a576a4c9723c7e69de55a054 (diff)
downloadu-boot-feb6179ffefa455e8c88a9612528419b49c408a0.tar.xz
board: stm32mp1: use IS_ENABLED to prevent ifdef in board_check_usb_power
Use IS_ENABLED to prevent ifdef in board_check_usb_power. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'board/st')
-rw-r--r--board/st/stm32mp1/stm32mp1.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 5c84b09c3e..3182f44598 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -288,7 +288,6 @@ static void __maybe_unused led_error_blink(u32 nb_blink)
hang();
}
-#ifdef CONFIG_ADC
static int board_check_usb_power(void)
{
struct ofnode_phandle_args adc_args;
@@ -300,6 +299,10 @@ static int board_check_usb_power(void)
int ret, uV, adc_count;
u32 nb_blink;
u8 i;
+
+ if (!IS_ENABLED(CONFIG_ADC))
+ return -ENODEV;
+
node = ofnode_path("/config");
if (!ofnode_valid(node)) {
debug("%s: no /config node?\n", __func__);
@@ -422,7 +425,6 @@ static int board_check_usb_power(void)
return 0;
}
-#endif /* CONFIG_ADC */
static void sysconf_init(void)
{
@@ -699,10 +701,8 @@ int board_late_init(void)
}
#endif
-#ifdef CONFIG_ADC
/* for DK1/DK2 boards */
board_check_usb_power();
-#endif /* CONFIG_ADC */
return 0;
}