Use the existing device_data for knc state data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
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 */