[PATCH u-boot-marvell v2 8/9] arm: mvebu: spl: Use IS_ENABLED() instead of #ifdef where possible

Pali Rohár pali at kernel.org
Tue Dec 14 10:36:00 CET 2021


On Friday 26 November 2021 15:37:37 Marek Behún wrote:
> @@ -340,17 +333,17 @@ void board_init_f(ulong dummy)
>  	timer_init();
>  
>  	/* Armada 375 does not support SerDes and DDR3 init yet */
> -#if !defined(CONFIG_ARMADA_375)
> -	/* First init the serdes PHY's */
> -	serdes_phy_config();
> -
> -	/* Setup DDR */
> -	ret = ddr3_init();
> -	if (ret) {
> -		debug("ddr3_init() failed: %d\n", ret);
> -		hang();
> +	if (!IS_ENABLED(CONFIG_ARMADA_375)) {
> +		/* First init the serdes PHY's */
> +		serdes_phy_config();
> +
> +		/* Setup DDR */
> +		ret = ddr3_init();
> +		if (ret) {
> +			debug("ddr3_init() failed: %d\n", ret);
> +			hang();
> +		}
>  	}
> -#endif

As written in comment above there is no SerDes and DDR3 support for
Armada 375 and therefore there is no serdes_phy_config() or ddr3_init()
function. So this code needs not to be compiled at all and usage of
#ifdef is correct here.


More information about the U-Boot mailing list