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.
Showing the changes to include/uapi (1 of 1 file). Show all
Unified · Split
| @@ -189,9 +189,8 @@ struct gpio_v2_line_config { · 188 unmodified lines | ||
| 189 | 189 | * buffer. If this field is zero then the buffer size defaults to a minimum |
| 190 | 190 | * of @num_lines * 16. |
| 191 | 191 | * @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 | |
| 195 | 194 | */ |
| 196 | 195 | struct gpio_v2_line_request { |
| 197 | 196 | __u32 offsets[GPIO_V2_LINES_MAX]; |
| @@ -402,9 +401,8 @@ struct gpioline_info_changed { · 204 unmodified lines | ||
| 402 | 401 | * such as "my-bitbanged-relay" |
| 403 | 402 | * @lines: number of lines requested in this request, i.e. the number of |
| 404 | 403 | * 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 | |
| 408 | 406 | * |
| 409 | 407 | * Note: This struct is part of ABI v1 and is deprecated. |
| 410 | 408 | * Use &struct gpio_v2_line_request instead. |
| @@ -465,9 +463,8 @@ struct gpiohandle_data { · 54 unmodified lines | ||
| 465 | 463 | * %GPIOEVENT_REQUEST_RISING_EDGE or %GPIOEVENT_REQUEST_FALLING_EDGE |
| 466 | 464 | * @consumer_label: a desired consumer label for the selected GPIO line(s) |
| 467 | 465 | * 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 | |
| 471 | 468 | * |
| 472 | 469 | * Note: This struct is part of ABI v1 and is deprecated. |
| 473 | 470 | * Use &struct gpio_v2_line_request instead. |