Browse Source

Bugfix: nanofury: Set cgpu_data for all processors (eg, to avoid crashing in nanofury_set_ledmode for non-first procs)

Luke Dashjr 12 years ago
parent
commit
b4e1c2a3e3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      driver-nanofury.c

+ 2 - 1
driver-nanofury.c

@@ -350,15 +350,16 @@ bool nanofury_init(struct thr_info * const thr)
 	port->speed = state->current_baud;
 	port->speed = state->current_baud;
 		
 		
 	state->mcp = mcp;
 	state->mcp = mcp;
-	thr->cgpu_data = state;
 	port->userp = state;
 	port->userp = state;
 	for (proc = cgpu; proc; (proc = proc->next_proc), ++bitfury)
 	for (proc = cgpu; proc; (proc = proc->next_proc), ++bitfury)
 	{
 	{
+		struct thr_info * const mythr = proc->thr[0];
 		*bitfury = (struct bitfury_device){
 		*bitfury = (struct bitfury_device){
 			.spi = port,
 			.spi = port,
 			.fasync = proc->proc_id,
 			.fasync = proc->proc_id,
 		};
 		};
 		proc->device_data = bitfury;
 		proc->device_data = bitfury;
+		mythr->cgpu_data = state;
 		bitfury->osc6_bits = 50;
 		bitfury->osc6_bits = 50;
 		bitfury_send_reinit(bitfury->spi, bitfury->slot, bitfury->fasync, bitfury->osc6_bits);
 		bitfury_send_reinit(bitfury->spi, bitfury->slot, bitfury->fasync, bitfury->osc6_bits);
 		bitfury_init_chip(proc);
 		bitfury_init_chip(proc);