Commit 13c199c5ab39b4a03f087d5a4e412d61bd97c6c0

Con Kolivas 2014-02-26T23:09:48

Only start one hfa device at startup, leaving the rest to hotplug.

diff --git a/driver-hashfast.c b/driver-hashfast.c
index 033ed97..68032d0 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -831,12 +831,16 @@ static struct cgpu_info *hfa_detect_one(libusb_device *dev, struct usb_find_devi
 	return hashfast;
 }
 
-static void hfa_detect(bool __maybe_unused hotplug)
+/* As slow init can make subsequent inits fail, only initialise one device
+ * to start with, leaving the rest to hotplug. */
+static void hfa_detect(bool hotplug)
 {
 	/* Set up the CRC tables only once. */
-	if (!hfa_crc8_set)
+	if (!hfa_crc8_set) {
 		hfa_init_crc8();
-	usb_detect(&hashfast_drv, hfa_detect_one);
+		usb_detect(&hashfast_drv, hfa_detect_one);
+	} else if (hotplug)
+		usb_detect(&hashfast_drv, hfa_detect_one);
 }
 
 static bool hfa_get_packet(struct cgpu_info *hashfast, struct hf_header *h)