#include <mtd.h>
#include <linux/mtd/mtd.h>
-@@ -24,7 +31,19 @@ int board_init(void)
+@@ -24,7 +31,22 @@ int board_init(void)
int board_late_init(void)
{
+ if (!button_get_by_label(CONFIG_RESET_BUTTON_LABEL, &dev)) {
+ puts("reset button found\n");
+#ifdef CONFIG_RESET_BUTTON_SETTLE_DELAY
-+ mdelay(CONFIG_RESET_BUTTON_SETTLE_DELAY);
++ if (CONFIG_RESET_BUTTON_SETTLE_DELAY > 0) {
++ button_get_state(dev);
++ mdelay(CONFIG_RESET_BUTTON_SETTLE_DELAY);
++ }
+#endif
+ if (button_get_state(dev) == BUTTON_ON) {
+ puts("button pushed, resetting environment\n");