Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface

From: David Brownell
Date: Wed Apr 30 2008 - 22:13:36 EST


> >  This is
> > very helpful for people connecting something to the interface to know they
> > have the write gpio lines connected.  What's the point of allowing
> > one to label gpio lines if it's not going to be easy to see?
>
> That label was always just supposed to be a debugging aid, i.e.
> something to show up in debugfs.  This is used to reduce D footprint.
> Maybe if the labels are being stored anyway they can be made available
> through sysfs as well as debugfs?

They could be; I've had code to do it. It never stays in
very long, because for a pure userspace interace it can't
be helpful unless userspace makes the labels: the labels
displayed otherwise just reuse the same constant.

For a "kernel cooperates with userspace" model that might
be more useful. And I've certainly found the debugfs info
hard to interpret without such labels!! But Trent has
said he doesn't see anyone modifying enough code to adopt
such a "cooperates" model. Which is why this particular
side-argument seems like a waste of time to me: even he
has not proposed the key change his argument depends on.


The original control file syntax I thought about was

export NN mode label

where it would gpio_request(NN, "label") and then set the
direction (and maybe value) according to "mode". But that
was just a PITA to cope with ... so it's now been trimmed
down to just "NN" (and "-NN").

- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/