Provide a noop thread_enable function for drivers that don't support it.
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
diff --git a/cgminer.c b/cgminer.c
index e33dfa9..2d45323 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -5353,8 +5353,7 @@ static void mt_disable(struct thr_info *mythr, const int thr_id,
} while (mythr->pause);
thread_reportin(mythr);
applog(LOG_WARNING, "Thread %d being re-enabled", thr_id);
- if (drv->thread_enable)
- drv->thread_enable(mythr);
+ drv->thread_enable(mythr);
}
void *miner_thread(void *userdata)
@@ -6361,9 +6360,10 @@ extern struct device_drv modminer_drv;
extern struct device_drv ztex_drv;
#endif
-
static int cgminer_id_count = 0;
+/* Various noop functions for drivers that don't support or need their
+ * variants. */
static void noop_reinit_device(struct cgpu_info __maybe_unused *cgpu)
{
}
@@ -6410,6 +6410,10 @@ static void noop_thread_shutdown(struct thr_info __maybe_unused *thr)
{
}
+static void noop_thread_enable(struct thr_info __maybe_unused *thr)
+{
+}
+
/* Fill missing driver api functions with noops */
void fill_device_api(struct cgpu_info *cgpu)
{
@@ -6435,6 +6439,8 @@ void fill_device_api(struct cgpu_info *cgpu)
drv->hw_error = &noop_hw_error;
if (!drv->thread_shutdown)
drv->thread_shutdown = &noop_thread_shutdown;
+ if (!drv->thread_enable)
+ drv->thread_enable = &noop_thread_enable;
}
void enable_device(struct cgpu_info *cgpu)