board: ti: j721s2: Use IS_ENABLED in place of #if

IS_ENABLED is the recommendation for checking CONFIG flags.
Use it instead of #if, and drop redundant checking of DM_GPIO
and OF_LIBFDT. #if defined(CONFIG_SPL_BUILD) can't be removed
from spl_perform_fixups, as it results in compile error.

Signed-off-by: Apurva Nandan <a-nandan@ti.com>
This commit is contained in:
Apurva Nandan 2023-10-07 04:29:39 +05:30 committed by Udit Kumar
parent 0be2deaeaa
commit 7c37b21c99
1 changed files with 23 additions and 26 deletions

View File

@ -73,10 +73,10 @@ int dram_init_banksize(void)
return 0; return 0;
} }
#if CONFIG_IS_ENABLED(DM_GPIO) && CONFIG_IS_ENABLED(OF_LIBFDT)
/* Enables the spi-nand dts node, if onboard mux is set to spinand */ /* Enables the spi-nand dts node, if onboard mux is set to spinand */
static void __maybe_unused detect_enable_spinand(void *blob) static void __maybe_unused detect_enable_spinand(void *blob)
{ {
if (IS_ENABLED(CONFIG_DM_GPIO) && IS_ENABLED(CONFIG_OF_LIBFDT)) {
struct gpio_desc desc = {0}; struct gpio_desc desc = {0};
char *ospi_mux_sel_gpio = "6"; char *ospi_mux_sel_gpio = "6";
int nand_offset, nor_offset; int nand_offset, nor_offset;
@ -102,13 +102,11 @@ static void __maybe_unused detect_enable_spinand(void *blob)
fdt_del_node(blob, nand_offset); fdt_del_node(blob, nand_offset);
} }
} }
#endif }
#if defined(CONFIG_SPL_BUILD) && (defined(CONFIG_TARGET_J721S2_A72_EVM) || \ #if defined(CONFIG_SPL_BUILD)
defined(CONFIG_TARGET_J721S2_R5_EVM))
void spl_perform_fixups(struct spl_image_info *spl_image) void spl_perform_fixups(struct spl_image_info *spl_image)
{ {
if (IS_ENABLED(CONFIG_DM_GPIO) && IS_ENABLED(CONFIG_OF_LIBFDT))
detect_enable_spinand(spl_image->fdt_addr); detect_enable_spinand(spl_image->fdt_addr);
} }
#endif #endif
@ -125,7 +123,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
if (ret) if (ret)
printf("%s: fixing up msmc ram failed %d\n", __func__, ret); printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
if (IS_ENABLED(CONFIG_DM_GPIO) && IS_ENABLED(CONFIG_OF_LIBFDT))
detect_enable_spinand(blob); detect_enable_spinand(blob);
return ret; return ret;