diff options
author | Darren Hart <dvhart@linux.intel.com> | 2014-09-16 17:56:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-19 17:44:51 -0400 |
commit | 00e262fd8744678262a0f662f1b5d45fc1f52e10 (patch) | |
tree | 2360b2b137f26fcbae384c973cfd0e2611685d79 /Documentation/sysfs-rules.txt | |
parent | 9e82bf014195d6f0054982c463575cdce24292be (diff) |
Documentation/sysfs-rules.txt: Add device attribute error code documentation
Provide some entry-level statements about what to expect from sysfs
device attribute read/store return codes, both for users and kernel
developers.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Azael Avalos <coproscefalo@gmail.com>
Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/sysfs-rules.txt')
-rw-r--r-- | Documentation/sysfs-rules.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Documentation/sysfs-rules.txt b/Documentation/sysfs-rules.txt index a5f985ee1822..ce60ffa94d2d 100644 --- a/Documentation/sysfs-rules.txt +++ b/Documentation/sysfs-rules.txt | |||
@@ -161,3 +161,24 @@ versions of the sysfs interface. | |||
161 | the device that matches the expected subsystem. Depending on a specific | 161 | the device that matches the expected subsystem. Depending on a specific |
162 | position of a parent device or exposing relative paths using "../" to | 162 | position of a parent device or exposing relative paths using "../" to |
163 | access the chain of parents is a bug in the application. | 163 | access the chain of parents is a bug in the application. |
164 | |||
165 | - When reading and writing sysfs device attribute files, avoid dependency | ||
166 | on specific error codes wherever possible. This minimizes coupling to | ||
167 | the error handling implementation within the kernel. | ||
168 | |||
169 | In general, failures to read or write sysfs device attributes shall | ||
170 | propagate errors wherever possible. Common errors include, but are not | ||
171 | limited to: | ||
172 | |||
173 | -EIO: The read or store operation is not supported, typically returned by | ||
174 | the sysfs system itself if the read or store pointer is NULL. | ||
175 | |||
176 | -ENXIO: The read or store operation failed | ||
177 | |||
178 | Error codes will not be changed without good reason, and should a change | ||
179 | to error codes result in user-space breakage, it will be fixed, or the | ||
180 | the offending change will be reverted. | ||
181 | |||
182 | Userspace applications can, however, expect the format and contents of | ||
183 | the attribute files to remain consistent in the absence of a version | ||
184 | attribute change in the context of a given attribute. | ||