On Fri, 4 Apr 2008, David Brownell wrote:This was intentional. When you're developing said kernel drivers, or connecting hardware they're supposed to drive, it's very handy to be able to set and read the GPIOs from userspace. At least, when writing a gpiolib driver and code that used gpiolib, I found this ability very useful, so I thought other developers might as well. I suppose one could make the sys files read-only once a kernel driver allocates a gpio. But it would be nice to have the ability to make them writable, if one really wants that. Couldn't they always add one? My GPIO driver is part of the CPU/SoC, and it has a device node. It's pretty easy to add a platform device, and probably cleaner than not associating a device with the gpio driver. From my understanding of sysfs, it seems any sysfs based approach has to be based on a device. Suppose I took the code I had, and make the label file writable? Writing to it allocates the gpio with the written label? That would be relatively simple to add. Is there any reason why the GPIOs should appear in sysfs by default? They are devices, and most other devices appear in sysfs. Write a blank label? Too bad one can't "rm" sysfs files, that would be a neat way to trigger stuff. I can see it used to hot-unplug a pci device, just delete the slot. --
| Ingo Molnar | [bug] block subsystem related crash with latest -git |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Adrian Bunk | Re: net/ipv4/fib_trie.c - compile error (Re: 2.6.23-rc3-mm1) |
git: | |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
