Make it possible to support devices with no buttons
[oweals/u-boot_mod.git] / u-boot / common / cmd_custom.c
index ee4afdde5ea3b552ed6c6895284f7da5665e322a..a1c9908c01d38057e83c01a9bf5a79c51407b1a5 100644 (file)
@@ -248,7 +248,8 @@ U_BOOT_CMD(defenv, 1, 0, do_default_env, "reset environment variables to their d
  * button && echo pressed!
  * button || echo not pressed!
  */
-#if defined(CONFIG_CMD_BUTTON)
+#if defined(CONFIG_CMD_BUTTON) &&\
+    defined(CONFIG_GPIO_RESET_BTN)
 int do_button(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
 #if defined(CFG_HUSH_PARSER)
@@ -267,7 +268,7 @@ int do_button(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 
 U_BOOT_CMD(button, 1, 1, do_button,
        "get reset button status\n", NULL);
-#endif /* CONFIG_CMD_BUTTON */
+#endif /* CONFIG_CMD_BUTTON && CONFIG_GPIO_RESET_BTN */
 
 /*
  * Allows to delay execution