[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091210152452.GA13519@suse.de>
Date: Thu, 10 Dec 2009 07:24:52 -0800
From: Greg KH <gregkh@...e.de>
To: Kay Sievers <kay.sievers@...y.org>
Cc: Jani Nikula <ext-jani.1.nikula@...ia.com>,
"dbrownell@...rs.sourceforge.net" <dbrownell@...rs.sourceforge.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dsilvers@...tec.co.uk" <dsilvers@...tec.co.uk>,
"ben@...tec.co.uk" <ben@...tec.co.uk>,
"Bityutskiy Artem (Nokia-D/Helsinki)" <Artem.Bityutskiy@...ia.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/3] gpiolib: add support for having symlinks under
gpio class directory
On Thu, Dec 10, 2009 at 04:17:00PM +0100, Kay Sievers wrote:
> On Thu, Dec 10, 2009 at 15:49, Greg KH <gregkh@...e.de> wrote:
> > On Thu, Dec 10, 2009 at 04:32:17PM +0200, Jani Nikula wrote:
> >> We simply decided to extend gpio_export_link(). When it is called
> >> with 'dev == NULL' (no driver), it creates an additional symlink
> >> in /sys/class/gpio/
> >>
> >> # ls -l /sys/class/gpio/
> >> --w------- 1 root 0 4096 Jan 1 00:00 export
> >> lrwxrwxrwx 1 root 0 0 Jan 1 00:00 power_button -> ../../devices/virtual/gpio/gpio25
> >> lrwxrwxrwx 1 root 0 0 Jan 1 00:00 gpio25 -> ../../devices/virtual/gpio/gpio25
> >> lrwxrwxrwx 1 root 0 0 Jan 1 00:00 gpio38 -> ../../devices/virtual/gpio/gpio38
> >> ...
> >>
> >> This is exactly what our patchset allows to do.
> >>
> >> An alternative would be a dummy driver just to create a home in sysfs
> >> for the standalone GPIOs and use the gpio_export_link() to make the
> >> links there.
> >>
> >> Any other suggestions?
>
> We can not do anything like that. The symlink name must always match
> the name in /sys/devices/, and it must be a 1:1 relation. We can not
> allow anything else, it confuses tools which rightfully expect this.
>
> You could convert the class to a "bus", the /sys/class layout is
> pretty much broken by design, and should better be avoided. It's not
> extensible, flat in its layout, and today just a too dumb version of
> the "bus" subsystem which does not have all these limitations.
>
> All the device links would show up in /sys/bus/gpio/devices/, here you
> have the same rules as in /sys/class/: no additional symlinks, the
> same names as in /sys/devices -- but you could add a custom folder to
> the /sys/bus/gpio/ directory where you could do whatever fits your
> needs. :)
Ah, yeah, good point, the pci "slots" directory does something like this
today, with symlinks pointing out of that directory to other devices.
It's messy, but it somehow works...
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists