Browse Source

Merge branch 'icarus_parallel' into bfgminer

Luke Dashjr 14 years ago
parent
commit
55c34b6d17
1 changed files with 3 additions and 6 deletions
  1. 3 6
      driver-icarus.c

+ 3 - 6
driver-icarus.c

@@ -385,17 +385,14 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
 	}
 
 	// Reopen the serial port to workaround a USB-host-chipset-specific issue with the Icarus's buggy USB-UART
+	icarus_close(fd);
 	fd = icarus_open(icarus->device_path);
 	if (unlikely(-1 == fd)) {
 		applog(LOG_ERR, "Failed to reopen Icarus on %s",
 		       icarus->device_path);
-		fd = icarus->device_fd;
-	}
-	else
-	{
-		icarus_close(icarus->device_fd);
-		icarus->device_fd = fd;
+		return 0;
 	}
+	icarus->device_fd = fd;
 
 	work->blk.nonce = 0xffffffff;