Commit ac7dc468e2d744adff38338c5b81d63dae7962cc

Con Kolivas 2013-10-28T14:27:57

Use the existing device_data for knc state data.

diff --git a/driver-knc-spi-fpga.c b/driver-knc-spi-fpga.c
index c6f542b..b754870 100644
--- a/driver-knc-spi-fpga.c
+++ b/driver-knc-spi-fpga.c
@@ -365,7 +365,7 @@ static void knc_work_from_queue_to_spi(struct knc_state *knc,
 static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu,
 				    struct spi_rx_t *rxbuf, int __maybe_unused num)
 {
-	struct knc_state *knc = cgpu->knc_state;
+	struct knc_state *knc = cgpu->device_data;
 	struct work *work;
 	int64_t us;
 	int submitted, successful, i, num_sent;
@@ -568,7 +568,7 @@ static bool knc_detect_one(struct spidev_context *ctx)
 	cgpu->name = "KnCminer";
 	cgpu->threads = 1;	// .. perhaps our number of devices?
 
-	cgpu->knc_state = knc;
+	cgpu->device_data = knc;
 	add_cgpu(cgpu);
 
 	return true;
@@ -612,7 +612,7 @@ void knc_detect(bool __maybe_unused hotplug)
 static int64_t knc_scanwork(struct thr_info *thr)
 {
 	struct cgpu_info *cgpu = thr->cgpu;
-	struct knc_state *knc = cgpu->knc_state;
+	struct knc_state *knc = cgpu->device_data;
 	int len, num;
 	int next_read_q;
 
@@ -646,7 +646,7 @@ static int64_t knc_scanwork(struct thr_info *thr)
 
 static bool knc_queue_full(struct cgpu_info *cgpu)
 {
-	struct knc_state *knc = cgpu->knc_state;
+	struct knc_state *knc = cgpu->device_data;
 	struct work *work;
 	int queue_full = true;
 
@@ -666,7 +666,7 @@ static bool knc_queue_full(struct cgpu_info *cgpu)
 
 static void knc_flush_work(struct cgpu_info *cgpu)
 {
-	struct knc_state *knc = cgpu->knc_state;
+	struct knc_state *knc = cgpu->device_data;
 	struct work *work;
 	int len;
 	int next_read_q, next_read_a;
diff --git a/miner.h b/miner.h
index 1e6f4ef..601e3d1 100644
--- a/miner.h
+++ b/miner.h
@@ -497,9 +497,6 @@ struct cgpu_info {
 	bool polling;
 	bool flash_led;
 #endif /* USE_BITFORCE */
-#if defined(USE_KNC)
-	struct knc_state *knc_state;
-#endif
 #if defined(USE_BITFORCE) || defined(USE_BFLSC)
 	pthread_mutex_t device_mutex;
 #endif /* USE_BITFORCE || USE_BFLSC */