Don't run device restart code if the device is not enabled.
diff --git a/cgminer.c b/cgminer.c
index e1e4f87..8b7fc7e 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3880,6 +3880,8 @@ static void restart_threads(void)
cgpu = mining_thr[i]->cgpu;
if (unlikely(!cgpu))
continue;
+ if (cgpu->deven != DEV_ENABLED)
+ continue;
mining_thr[i]->work_restart = true;
flush_queue(cgpu);
cgpu->drv->flush_work(cgpu);