diff mbox series

[U-Boot,v2,2/5] ti: am335x: Fix bootargs when building without NET

Message ID 1522574558-7445-3-git-send-email-alex.kiernan@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show
Series Build AM335x when CONFIG_NET isn't defined | expand

Commit Message

Alex Kiernan April 1, 2018, 9:22 a.m. UTC
If DHCP/PXE commands are disabled then the compilation fails due to
bootargs attempting to use them:

  include/config_distro_bootcmd.h:319:2: error: expected ‘}’ before ‘BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE’

Ensure that if the command aren't enabled, we don't try and use them.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---

Changes in v2: None

 include/configs/am335x_evm.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

Comments

Tom Rini April 9, 2018, 3:03 p.m. UTC | #1
On Sun, Apr 01, 2018 at 09:22:35AM +0000, Alex Kiernan wrote:

> If DHCP/PXE commands are disabled then the compilation fails due to
> bootargs attempting to use them:
> 
>   include/config_distro_bootcmd.h:319:2: error: expected ‘}’ before ‘BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE’
> 
> Ensure that if the command aren't enabled, we don't try and use them.
> 
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 158b7d4..e8b4125 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -74,14 +74,26 @@ 
 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
 	#devtypel #instance " "
 
+#if CONFIG_IS_ENABLED(CMD_PXE)
+# define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
+#else
+# define BOOT_TARGET_PXE(func)
+#endif
+
+#if CONFIG_IS_ENABLED(CMD_DHCP)
+# define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
+#else
+# define BOOT_TARGET_DHCP(func)
+#endif
+
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \
 	func(LEGACY_MMC, legacy_mmc, 0) \
 	func(MMC, mmc, 1) \
 	func(LEGACY_MMC, legacy_mmc, 1) \
 	func(NAND, nand, 0) \
-	func(PXE, pxe, na) \
-	func(DHCP, dhcp, na)
+	BOOT_TARGET_PXE(func) \
+	BOOT_TARGET_DHCP(func)
 
 #include <config_distro_bootcmd.h>