error-codes.rst 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. .. SPDX-License-Identifier: GPL-2.0
  2. .. _gpio_errors:
  3. *******************
  4. GPIO Error Codes
  5. *******************
  6. .. _gpio-errors:
  7. .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
  8. .. flat-table:: Common GPIO error codes
  9. :header-rows: 0
  10. :stub-columns: 0
  11. :widths: 1 16
  12. - - ``EAGAIN`` (aka ``EWOULDBLOCK``)
  13. - The device was opened in non-blocking mode and a read can't
  14. be performed as there is no data available.
  15. - - ``EBADF``
  16. - The file descriptor is not valid.
  17. - - ``EBUSY``
  18. - The ioctl can't be handled because the device is busy. Typically
  19. returned when an ioctl attempts something that would require the
  20. usage of a resource that was already allocated. The ioctl must not
  21. be retried without performing another action to fix the problem
  22. first.
  23. - - ``EFAULT``
  24. - There was a failure while copying data from/to userspace, probably
  25. caused by an invalid pointer reference.
  26. - - ``EINVAL``
  27. - One or more of the ioctl parameters are invalid or out of the
  28. allowed range. This is a widely used error code.
  29. - - ``ENODEV``
  30. - Device not found or was removed.
  31. - - ``ENOMEM``
  32. - There's not enough memory to handle the desired operation.
  33. - - ``EPERM``
  34. - Permission denied. Typically returned in response to an attempt
  35. to perform an action incompatible with the current line
  36. configuration.
  37. - - ``EIO``
  38. - I/O error. Typically returned when there are problems communicating
  39. with a hardware device or requesting features that hardware does not
  40. support. This could indicate broken or flaky hardware.
  41. It's a 'Something is wrong, I give up!' type of error.
  42. - - ``ENXIO``
  43. - Typically returned when a feature requiring interrupt support was
  44. requested, but the line does not support interrupts.
  45. .. note::
  46. #. This list is not exhaustive; ioctls may return other error codes.
  47. Since errors may have side effects such as a driver reset,
  48. applications should abort on unexpected errors, or otherwise
  49. assume that the device is in a bad state.
  50. #. Request-specific error codes are listed in the individual
  51. requests descriptions.