[vox-tech] lego USB tower

Peter Jay Salzman vox-tech@lists.lugod.org
Sun, 7 Jul 2002 09:59:41 -0700


sent to the author of the lego USB tower device driver.  any comments
welcome.



----- Forwarded message from p -----

dear richard,

this morning i tried out the lego linux USB patch.   the patches applied
flawlessly to the kernel source code (2.4.18) and to the most recent nqc
source code.

i made a char device file of (major/minor) number of (180/64) called
/dev/legotower.

did a modprobe -a lego and this is what was printed:

  satan# modprobe -a lego
  usb.c: registered new driver Lego Tower
  lego.c: probe_lego: USB Lego Tower (interface 0) found at address 2
  lego.c: probe_lego: Allocated minor 0
  lego.c: probe_lego: device node registration failed
  lego.c: v1.0:USB Lego driver

using lsmod i see that lego.o and the associated usb modules have
loaded.  there are two curious things about the above output:

first, lego was assigned minor number 0, when it should've taken 64.

second, the "device node registration failed" message is disheartening.

going through the code, i see in function static void *probe_lego:

   if(lego->devfs == NULL)
   {
      err(__FUNCTION__ ": device node registration failed");
      goto probe_exit;
   }

   probe_exit:

   if(err)
   {
      free_lego_resources(lego);
      lego = NULL;
   }


to my untrained eyes, this code looks like the module can't be used
unless the system is a devfs system.  i'm assuming that lego->devfs is
NULL for non devfs systems and that err() sets err, some "errno-like"
variable.

is this not correct?

and if it is correct, then i'm thinking that lego.o should unload
itself.

any thoughts on how to get this module to use the correct minor number
(other than compiling devfs into the kernel).

thanks!
pete

-- 
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D