]> git.lizzy.rs Git - plan9front.git/commitdiff
nusb: put setleds in kbwork
authorcinap_lenrek <cinap_lenrek@localhost>
Mon, 1 Aug 2011 00:01:04 +0000 (02:01 +0200)
committercinap_lenrek <cinap_lenrek@localhost>
Mon, 1 Aug 2011 00:01:04 +0000 (02:01 +0200)
sys/src/cmd/nusb/kb/kb.c

index 66a964decc7ca870cbf2f8e5192ecae16225bfe4..f2d1ea79bdbadfc884e3ca5aa95bef50ab3fd970 100644 (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);
 }