Browse Source

Merge branch 'hotplug2' into bfgminer

Luke Dashjr 12 years ago
parent
commit
5bff3422b7
2 changed files with 9 additions and 6 deletions
  1. 1 1
      driver-avalon.c
  2. 8 5
      fpgautils.c

+ 1 - 1
driver-avalon.c

@@ -571,7 +571,7 @@ static bool avalon_detect_one(const char *devpath)
 	int baud, miner_count, asic_count, timeout, frequency = 0;
 	struct cgpu_info *avalon;
 
-	if (serial_claim(devpath, avalon_drv))
+	if (serial_claim(devpath, &avalon_drv))
 		return false;
 	
 	int this_option_offset = ++option_offset;

+ 8 - 5
fpgautils.c

@@ -497,13 +497,16 @@ struct device_drv *bfg_claim_serial(struct device_drv * const api, const bool ve
 
 struct device_drv *bfg_claim_usb(struct device_drv * const api, const bool verbose, const uint8_t usbbus, const uint8_t usbaddr)
 {
-	const my_dev_t dev = {
-		.bus = BDB_USB,
-		.usbbus = usbbus,
-		.usbaddr = usbaddr,
-	};
+	my_dev_t dev;
 	char *desc = NULL;
 	
+	// We should be able to just initialize a const my_dev_t for this, but Xcode's clang is broken
+	// Affected: Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) AKA Xcode 4.6.3
+	// Works with const: GCC 4.6.3, LLVM 3.1
+	dev.bus = BDB_USB;
+	dev.usbbus = usbbus;
+	dev.usbaddr = usbaddr;
+	
 	if (verbose)
 	{
 		desc = alloca(3 + 1 + 3 + 1);