1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-29 16:04:33 +00:00

Provide a noop thread_init for drivers that don't support it.

This commit is contained in:
Con Kolivas 2013-02-09 19:50:07 +11:00
parent 8e12a05b47
commit b9f5b48c08

View File

@ -5386,7 +5386,7 @@ void *miner_thread(void *userdata)
gettimeofday(&getwork_start, NULL);
if (drv->thread_init && !drv->thread_init(mythr)) {
if (!drv->thread_init(mythr)) {
dev_error(cgpu, REASON_THREAD_FAIL_INIT);
goto out;
}
@ -6394,6 +6394,11 @@ static uint64_t noop_can_limit_work(struct thr_info __maybe_unused *thr)
return 0xffffffff;
}
static bool noop_thread_init(struct thr_info __maybe_unused *thr)
{
return true;
}
/* Fill missing driver api functions with noops */
void fill_device_api(struct cgpu_info *cgpu)
{
@ -6411,6 +6416,8 @@ void fill_device_api(struct cgpu_info *cgpu)
drv->thread_prepare = &noop_thread_prepare;
if (!drv->can_limit_work)
drv->can_limit_work = &noop_can_limit_work;
if (!drv->thread_init)
drv->thread_init = &noop_thread_init;
}
void enable_device(struct cgpu_info *cgpu)