gpiolib: cdev: add fdinfo output for line request file descriptors
authorBartosz Golaszewski <brgl@bgdev.pl>
Thu, 22 Sep 2022 09:51:24 +0000 (11:51 +0200)
committerBartosz Golaszewski <brgl@bgdev.pl>
Mon, 26 Sep 2022 12:15:38 +0000 (14:15 +0200)
commit0ae3109a839192920f09338e9abc4d5321107865
tree26b0bc8c7d79a2dc4f3edf81d0ae1077972fb851
parent361c1ca384c93013e08bd117e4fe23ca9739e3f7
gpiolib: cdev: add fdinfo output for line request file descriptors

Add fdinfo output for file descriptors created for user-space line
requests in GPIO uAPI v2. The fdinfo file now contains the name of the
GPIO chip that is the "parent" of the request as well as offsets of
the lines requested. This allows user-space to parse the /proc/$PID/fdinfo
entries and deduce the PID of the process that requested a specific line.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
drivers/gpio/gpiolib-cdev.c