linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Ott <alan@signal11.us>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Antonio Ospite <ospite@studenti.unina.it>,
	linux-hotplug@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: libudev, a question about the enumerate API.
Date: Mon, 07 Mar 2011 16:01:21 +0000	[thread overview]
Message-ID: <4D750151.7070904@signal11.us> (raw)
In-Reply-To: <AANLkTik7pPUYou9OwD0E5r-Wr3a67kQZPToDepZH8pLu@mail.gmail.com>

On 03/07/2011 10:27 AM, Kay Sievers wrote:
> The usual enumeration in udev never uses the device tree in
> /sys/devices/, only the subsystem lists /sys/{class,bus}/. We could
> have something to enumerate all child devices of a given device. It's
> not simple, but could be made working.
>    

Hi Kay,

The documentation in Documentation/sysfs-rules.txt seems to warn against 
using /sys/class and sys/bus:

- devices are only "devices"
   There is no such thing like class-, bus-, physical devices,
   interfaces, and such that you can rely on in userspace. Everything is
   just simply a "device". Class-, bus-, physical, ... types are just
   kernel implementation details which should not be expected by
   applications that look for devices in sysfs.

...
       - all elements of a devpath must be real directories. Symlinks
         pointing to /sys/devices must always be resolved to their real
         target and the target path must be used to access the device.
         That way the devpath to the device matches the devpath of the
         kernel used at event time.
       - using or exposing symlink values as elements in a devpath string
         is a bug in the application

...

       - accessing attributes reached by a symlink pointing to another 
device,
         like the "device"-link, is a bug in the application

...

- Hierarchy in a single device tree
   There is only one valid place in sysfs where hierarchy can be examined
   and this is below: /sys/devices.

and more...

I figured that this document was probably out of date, since even 
libudev uses /sys/class. What's your take on this document?

Alan.



  reply	other threads:[~2011-03-07 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 22:50 libudev, a question about the enumerate API Antonio Ospite
2011-03-07 15:27 ` Kay Sievers
2011-03-07 16:01   ` Alan Ott [this message]
2011-03-07 16:11     ` Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D750151.7070904@signal11.us \
    --to=alan@signal11.us \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=ospite@studenti.unina.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).