History

gpio: uapi: improve description of fd fields

Only a successful operation modifies fd fields, but the current documentation wording could be taken to imply that a positive fd value after an ioctl() returns indicates a success. Reword documentation to clarify that the fd is only valid after a successful operation.

Kent Gibson committed 2 years ago

Commit 78899681 parent f4028861 file · +6 −9Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/gpio.h+6−9
@@ -189,9 +189,8 @@ struct gpio_v2_line_config { · 188 unmodified lines
189189 * buffer. If this field is zero then the buffer size defaults to a minimum
190190 * of @num_lines * 16.
191191 * @padding: reserved for future use and must be zero filled
192− * @fd: if successful this field will contain a valid anonymous file handle
193− * after a %GPIO_GET_LINE_IOCTL operation, zero or negative value means
194− * error
192+ * @fd: after a successful %GPIO_V2_GET_LINE_IOCTL operation, contains
193+ * a valid anonymous file descriptor representing the request
195194 */
196195 struct gpio_v2_line_request {
197196 __u32 offsets[GPIO_V2_LINES_MAX];
@@ -402,9 +401,8 @@ struct gpioline_info_changed { · 204 unmodified lines
402401 * such as "my-bitbanged-relay"
403402 * @lines: number of lines requested in this request, i.e. the number of
404403 * valid fields in the above arrays, set to 1 to request a single line
405− * @fd: if successful this field will contain a valid anonymous file handle
406− * after a %GPIO_GET_LINEHANDLE_IOCTL operation, zero or negative value
407− * means error
404+ * @fd: after a successful %GPIO_GET_LINEHANDLE_IOCTL operation, contains
405+ * a valid anonymous file descriptor representing the request
408406 *
409407 * Note: This struct is part of ABI v1 and is deprecated.
410408 * Use &struct gpio_v2_line_request instead.
@@ -465,9 +463,8 @@ struct gpiohandle_data { · 54 unmodified lines
465463 * %GPIOEVENT_REQUEST_RISING_EDGE or %GPIOEVENT_REQUEST_FALLING_EDGE
466464 * @consumer_label: a desired consumer label for the selected GPIO line(s)
467465 * such as "my-listener"
468− * @fd: if successful this field will contain a valid anonymous file handle
469− * after a %GPIO_GET_LINEEVENT_IOCTL operation, zero or negative value
470− * means error
466+ * @fd: after a successful %GPIO_GET_LINEEVENT_IOCTL operation, contains a
467+ * valid anonymous file descriptor representing the request
471468 *
472469 * Note: This struct is part of ABI v1 and is deprecated.
473470 * Use &struct gpio_v2_line_request instead.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t