diff options
author | Patrick Delaunay | 2020-07-31 16:31:46 +0200 |
---|---|---|
committer | Patrice Chotard | 2020-08-13 09:52:49 +0200 |
commit | 75f9b190e4086d683ccde5cffe2144437d7501c5 (patch) | |
tree | 8de2153c5c225131dd6373a31002d6085d63e697 /board/st | |
parent | 3434bbe698427bcc27e98e7e04929e72d59ccbcd (diff) |
board: stm32mp1: use IS_ENABLED to prevent ifdef in set_dfu_alt_inf
Use CONFIG_IS_ENABLED to prevent ifdef in set_dfu_alt_inf.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'board/st')
-rw-r--r-- | board/st/common/stm32mp_dfu.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c index 38eb0f27c90..aab7d741ac6 100644 --- a/board/st/common/stm32mp_dfu.c +++ b/board/st/common/stm32mp_dfu.c @@ -114,11 +114,13 @@ void set_dfu_alt_info(char *interface, char *devstr) snprintf(buf, DFU_ALT_BUF_LEN, "ram 0=%s", CONFIG_DFU_ALT_RAM0); - if (!uclass_get_device(UCLASS_MMC, 0, &dev)) - board_get_alt_info_mmc(dev, buf); + if (CONFIG_IS_ENABLED(MMC)) { + if (!uclass_get_device(UCLASS_MMC, 0, &dev)) + board_get_alt_info_mmc(dev, buf); - if (!uclass_get_device(UCLASS_MMC, 1, &dev)) - board_get_alt_info_mmc(dev, buf); + if (!uclass_get_device(UCLASS_MMC, 1, &dev)) + board_get_alt_info_mmc(dev, buf); + } if (CONFIG_IS_ENABLED(MTD)) { /* probe all MTD devices */ @@ -140,12 +142,12 @@ void set_dfu_alt_info(char *interface, char *devstr) board_get_alt_info_mtd(mtd, buf); } -#ifdef CONFIG_DFU_VIRT - strncat(buf, "&virt 0=OTP", DFU_ALT_BUF_LEN); + if (IS_ENABLED(CONFIG_DFU_VIRT)) { + strncat(buf, "&virt 0=OTP", DFU_ALT_BUF_LEN); - if (IS_ENABLED(CONFIG_PMIC_STPMIC1)) - strncat(buf, "&virt 1=PMIC", DFU_ALT_BUF_LEN); -#endif + if (IS_ENABLED(CONFIG_PMIC_STPMIC1)) + strncat(buf, "&virt 1=PMIC", DFU_ALT_BUF_LEN); + } env_set("dfu_alt_info", buf); puts("DFU alt info setting: done\n"); |