I need to have the kernel automatically load scanner.o whenever I
attempt to use my scanner and autoclean (unload) when I'm done.
Hotplug does not fit my purpose because it will not unload the module
as long as the usb device (my scanner) is still plugged in.

When I manually modprobe scanner everything works and xsane accesses
the scanner device via:

crw-rw-rw- 1 root root 180, 48 Jun 22 18:42

Of course I need to manually unload the scanner.o module after I'm
done since scanner.o won't be autocleaned.

To fix this I created following entry in /etc/modules.conf to force
kmod to load my scanner module when xsane accesses it:

alias char-major-180-48 scanner

Unfortunately this does not seem to work. The module is never loaded
even though xsane does attempt to open(/dev/usb/scanner0). I verified
this with strace:

open("/dev/usb/scanner0", O_RDWR) = -1 ENODEV (No such device)

How can I force my kernel (2.4.21) to load scanner.o when device
180,48 is opened?

Thank for help,


Michal Sabala

PS. I need to automatically unload scanner.o because it seems to
malfunction after prolonged time in the kernel without being used.

PS2. I'm running Debian Testing if that makes a difference...