mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-23 23:22:02 +00:00
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>
This commit is contained in:
parent
6a8713bbe3
commit
feb6179ffe
1 changed files with 4 additions and 4 deletions
|
@ -288,7 +288,6 @@ static void __maybe_unused led_error_blink(u32 nb_blink)
|
||||||
hang();
|
hang();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ADC
|
|
||||||
static int board_check_usb_power(void)
|
static int board_check_usb_power(void)
|
||||||
{
|
{
|
||||||
struct ofnode_phandle_args adc_args;
|
struct ofnode_phandle_args adc_args;
|
||||||
|
@ -300,6 +299,10 @@ static int board_check_usb_power(void)
|
||||||
int ret, uV, adc_count;
|
int ret, uV, adc_count;
|
||||||
u32 nb_blink;
|
u32 nb_blink;
|
||||||
u8 i;
|
u8 i;
|
||||||
|
|
||||||
|
if (!IS_ENABLED(CONFIG_ADC))
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
node = ofnode_path("/config");
|
node = ofnode_path("/config");
|
||||||
if (!ofnode_valid(node)) {
|
if (!ofnode_valid(node)) {
|
||||||
debug("%s: no /config node?\n", __func__);
|
debug("%s: no /config node?\n", __func__);
|
||||||
|
@ -422,7 +425,6 @@ static int board_check_usb_power(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_ADC */
|
|
||||||
|
|
||||||
static void sysconf_init(void)
|
static void sysconf_init(void)
|
||||||
{
|
{
|
||||||
|
@ -699,10 +701,8 @@ int board_late_init(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ADC
|
|
||||||
/* for DK1/DK2 boards */
|
/* for DK1/DK2 boards */
|
||||||
board_check_usb_power();
|
board_check_usb_power();
|
||||||
#endif /* CONFIG_ADC */
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue