Skip to content

gpiolib: cdev: guard tidying

Kent Gibson linux-gpio lkml 2 versions – Applied

Status from this message: I applied the remaining patches, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 6 repliesApplied
  2. v14 patches 14 repliesSuperseded

Changes in v2 from the cover letter

- add patch 1 to protect gpio_ioctl() from chip removal
- improve commit comment (patch 3)
- use guard(rwsem_read) rather than rolling our own (patch 5)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/5gpiolib: cdev: add gpio_device locking wrapper around gpio_ioctl()drivers/gpio/gpiolib-cdev.c+12 -41 reply
2/5gpiolib: cdev: include overflow.hdrivers/gpio/gpiolib-cdev.c+1 -00 replies
3/5gpiolib: cdev: allocate linereq using kvzalloc()drivers/gpio/gpiolib-cdev.c+2 -20 replies
4/5gpiolib: cdev: replace locking wrappers for config_mutex with guardsdrivers/gpio/gpiolib-cdev.c+24 -390 replies
5/5gpiolib: cdev: replace locking wrappers for gpio_device with guardsdrivers/gpio/gpiolib-cdev.c+47 -1584 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/5] gpiolib: cdev: guard tidying

This series contains some tidying up of gpiolib-cdev following the recent adoption of guard().

The first patch is a fix to protect gpio_ioctl() from having the gpio chip removed while the ioctl is in progress.

The next couple of patches are minor fixes inspired by recent submissions and reviews for gpiolib.c.

Patch 2 adds a missing include.

Patch 3 switches allocation of struct linereq from kzalloc() to kvzalloc() as it can be larger than one page - even more so after the recent relocation of debounce_period_us.

The final two patches replace wrapper functions with guards.

Patch 4 tidies up the functions that use a guard on the linereq config_mutex.

Patch 5 tidies up the functions that use a guard on the gpio_device.

Changes v1 -> v2:
- add patch 1 to protect gpio_ioctl() from chip removal
- improve commit comment (patch 3)
- use guard(rwsem_read) rather than rolling our own (patch 5)

Cheers,
Kent.

Kent Gibson (5):
gpiolib: cdev: add gpio_device locking wrapper around gpio_ioctl()
gpiolib: cdev: include overflow.h
gpiolib: cdev: allocate linereq using kvzalloc()
gpiolib: cdev: replace locking wrappers for config_mutex with guards
gpiolib: cdev: replace locking wrappers for gpio_device with guards

 drivers/gpio/gpiolib-cdev.c | 257 ++++++++++--------------------------
 1 file changed, 70 insertions(+), 187 deletions(-)

--
2.39.2