Re: [PATCH 30/47] Driver core: create devices/virtual/ tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 26, 2006 at 09:51:04AM -0400, Dmitry Torokhov wrote:
> On 9/26/06, Greg KH <[email protected]> wrote:
> >On Tue, Sep 26, 2006 at 09:24:15AM -0400, Dmitry Torokhov wrote:
> >> On 9/26/06, Greg KH <[email protected]> wrote:
> >> >From: Greg Kroah-Hartman <[email protected]>
> >> >
> >> >This change creates a devices/virtual/CLASS_NAME tree for struct devices
> >> >that belong to a class, yet do not have a "real" struct device for a
> >> >parent.  It automatically creates the directories on the fly as needed.
> >> >
> >>
> >> Why do you need multiple virtual devices? All parentless class devices
> >> could grow from a single virtual device.
> >
> >They could, but it's a mess of a single directory if you do that.
> >Having /sys/devices/virtual/tty/ as a place for all tty virtual device
> >is nicer than /sys/devices/virtual/ as a single place for all of them
> >(mem, network, tty, misc, etc.)
> >
> 
> You supposed to use classes for classification, and devices to
> represent the tree so that would be /sys/class/tty/...

Yes, the symlink is still in /sys/class/tty, that hasn't gone away:
$ tree /sys/class/tty/
/sys/class/tty/
|-- console -> ../../devices/virtual/tty/console
|-- ptmx -> ../../devices/virtual/tty/ptmx
|-- tty -> ../../devices/virtual/tty/tty
|-- tty0 -> ../../devices/virtual/tty/tty0
|-- tty1 -> ../../devices/virtual/tty/tty1
|-- tty10 -> ../../devices/virtual/tty/tty10
...

It's just that /sys/devices/virtual would look very messy otherwise:
$ ls /sys/devices/virtual/
cpuid  input  mem  misc  msr  net  pci_bus  ppp  sound  tty  vc vtconsole

$ ls /sys/devices/virtual/*/ | wc -l
133

Also, that would mean that we could not have the name of a device
associated with a class to be the same as any other device associated
with any other class.  In the future that might be a problem, as our
namespace is only so big :)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux