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
189 * buffer. If this field is zero then the buffer size defaults to a minimum189 * buffer. If this field is zero then the buffer size defaults to a minimum
190 * of @num_lines * 16.190 * of @num_lines * 16.
191 * @padding: reserved for future use and must be zero filled191 * @padding: reserved for future use and must be zero filled
192 * @fd: if successful this field will contain a valid anonymous file handle192 * @fd: after a successful %GPIO_V2_GET_LINE_IOCTL operation, contains
193 * after a %GPIO_GET_LINE_IOCTL operation, zero or negative value means193 * a valid anonymous file descriptor representing the request
194 * error
195 */194 */
196struct gpio_v2_line_request {195struct gpio_v2_line_request {
197 __u32 offsets[GPIO_V2_LINES_MAX];196 __u32 offsets[GPIO_V2_LINES_MAX];
@@ -402,9 +401,8 @@ struct gpioline_info_changed { · 204 unmodified lines
402 * such as "my-bitbanged-relay"401 * such as "my-bitbanged-relay"
403 * @lines: number of lines requested in this request, i.e. the number of402 * @lines: number of lines requested in this request, i.e. the number of
404 * valid fields in the above arrays, set to 1 to request a single line403 * 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 handle404 * @fd: after a successful %GPIO_GET_LINEHANDLE_IOCTL operation, contains
406 * after a %GPIO_GET_LINEHANDLE_IOCTL operation, zero or negative value405 * a valid anonymous file descriptor representing the request
407 * means error
408 *406 *
409 * Note: This struct is part of ABI v1 and is deprecated.407 * Note: This struct is part of ABI v1 and is deprecated.
410 * Use &struct gpio_v2_line_request instead.408 * Use &struct gpio_v2_line_request instead.
@@ -465,9 +463,8 @@ struct gpiohandle_data { · 54 unmodified lines
465 * %GPIOEVENT_REQUEST_RISING_EDGE or %GPIOEVENT_REQUEST_FALLING_EDGE463 * %GPIOEVENT_REQUEST_RISING_EDGE or %GPIOEVENT_REQUEST_FALLING_EDGE
466 * @consumer_label: a desired consumer label for the selected GPIO line(s)464 * @consumer_label: a desired consumer label for the selected GPIO line(s)
467 * such as "my-listener"465 * such as "my-listener"
468 * @fd: if successful this field will contain a valid anonymous file handle466 * @fd: after a successful %GPIO_GET_LINEEVENT_IOCTL operation, contains a
469 * after a %GPIO_GET_LINEEVENT_IOCTL operation, zero or negative value467 * valid anonymous file descriptor representing the request
470 * means error
471 *468 *
472 * Note: This struct is part of ABI v1 and is deprecated.469 * Note: This struct is part of ABI v1 and is deprecated.
473 * Use &struct gpio_v2_line_request instead.470 * 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