[patch] Allow devices with no sysdevices

David Zeuthen david at fubar.dk
Tue May 25 10:47:55 PDT 2004

On Wed, 2004-05-19 at 12:10 -0400, Joe Shaw wrote:
> Hi,
> Attached is a patch which allows us to have class devices with no
> sysdevice, and adds support to the net class device to use it.
> This is needed because pcmcia doesn't use sysfs correctly in the 2.6
> kernel to date.  In order to avoid changing a ton of the existing code,
> I create a fake virtual sysdevice, and any devices which don't have a
> real sysdevice use it as its parent instead.
> One thing to note is that the "accept" method is now responsible for
> rejecting class devices without sysdevices and not the "visit" method.
> But almost all the class devices use the default class_device_accept()
> method so it isn't a big deal.
> With this, my PCMCIA wireless card shows up, albeit without any
> identifying information.  I suspect we might be able to do something
> similar for firewire devices.
> How's it look?

Hmm, I'm a bit reluctant to do this, I'd rather see the PCMCIA 16-bit
drivers publish their information in sysfs under /sys/devices. That will
also solve a lot of other problems like making the PCMCIA CF card reader
I bought usable with HAL. Oh well :-)

OTOH, this seems like a very usable thing though I'd like one fakeroot
device per class device instance this applies to since I may have more
than one 16-bit PCMCIA networking devices. It would also be nice to
enclose the code for doing this in #ifdef/#endif pairs so we can disable
it at compile time.

> +       hal_device_property_set_string (fakeroot, "info.product",
> +                                       "City of Lost Devices");

Heh, that's funny :-)


hal mailing list
hal at freedesktop.org

More information about the Hal mailing list