Commit f68930138d360fc3cd78ec71f332d72ae6bf015a

Xiangfu 2013-04-08T23:39:08

for some reason network down. one simple cgminer command: "cgminer -o 127.0.0.1:8888 -O fa:ke --avalon-options 115200:32:10:50:256" can idle the avalon for safe power and protect chip

diff --git a/driver-avalon.c b/driver-avalon.c
index b4932e6..29662e4 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -586,8 +586,8 @@ static bool avalon_detect_one(const char *devpath)
 	}
 	
 	avalon_infos = realloc(avalon_infos,
-			      sizeof(struct avalon_info *) *
-			      (total_devices + 1));
+			       sizeof(struct avalon_info *) *
+			       (total_devices + 1));
 
 	applog(LOG_INFO, "Avalon Detect: Found at %s, mark as %d",
 	       devpath, avalon->device_id);
@@ -618,14 +618,11 @@ static bool avalon_detect_one(const char *devpath)
 	info->temp_old = 0;
 	info->frequency = frequency;
 
-	/* Do something for failed reset ? */
-	if (0) {
-		/* Set asic to idle mode after detect */
-		avalon_idle(avalon);
-		avalon->device_fd = -1;
+	/* Set asic to idle mode after detect */
+	avalon_idle(avalon);
+	avalon->device_fd = -1;
 
-		avalon_close(fd);
-	}
+	avalon_close(fd);
 	return true;
 }