nusb: put setleds in kbwork

This commit is contained in:
cinap_lenrek 2011-08-01 02:01:04 +02:00
parent 5bf221bab7
commit e5bab1dd9f

View file

@ -451,6 +451,9 @@ kbdwork(void *a)
if(f->ep->maxpkt < 3 || f->ep->maxpkt > sizeof buf)
kbfatal(f, "weird maxpkt");
if(setleds(f, f->ep->id, 0) < 0)
kbfatal(f, "setleds failed");
f->repeatc = chancreate(sizeof(ulong), 0);
if(f->repeatc == nil)
kbfatal(f, "chancreate failed");
@ -543,10 +546,6 @@ kbstart(Dev *d, Ep *ep, Kin *in, void (*f)(void*), int accel)
kd->ep = nil;
return;
}
if(f == kbdwork && setleds(kd, ep->id, 0) < 0){
fprint(2, "kb: %s: setleds: %r\n", d->dir);
return;
}
incref(d);
proccreate(f, kd, Stack);
}