[Uboot-stm32] [PATCH 05/11] board: stm32mp1: use IS_ENABLED to prevent ifdef in set_dfu_alt_inf

Patrice CHOTARD patrice.chotard at st.com
Thu Aug 13 11:51:39 CEST 2020


On 8/13/20 9:23 AM, Patrice CHOTARD wrote:
> Hi Patrick
>
> On 7/31/20 4:31 PM, Patrick Delaunay wrote:
>> Use CONFIG_IS_ENABLED to prevent ifdef in set_dfu_alt_inf.
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
>> ---
>>
>>  board/st/common/stm32mp_dfu.c | 20 +++++++++++---------
>>  1 file changed, 11 insertions(+), 9 deletions(-)

Applied on u-boot-stm/master

Thanks

>>
>> diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
>> index 0cda9196f9..2fb307efe4 100644
>> --- a/board/st/common/stm32mp_dfu.c
>> +++ b/board/st/common/stm32mp_dfu.c
>> @@ -113,11 +113,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 */
>> @@ -139,12 +141,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");
> Reviewed-by: Patrice Chotard <patrice.chotard at st.com>
>
> Thanks
>
> Patrice
> _______________________________________________
> Uboot-stm32 mailing list
> Uboot-stm32 at st-md-mailman.stormreply.com
> https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32


More information about the U-Boot mailing list