Skip to content

Cleanup chardev instances with helper function

Logan Gunthorpe linux-fsdevel linux-gpio linux-input linux-media linux-mtd linux-nvdimm linux-pci linux-rdma linux-rtc linux-scsi lkml nvdimm stable 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest16 patches 0 repliesNew
  2. v41 of 16 patches 0 repliesSuperseded

Changes in v5 from the cover letter

* Fix a kbuild robot issue with the rtc driver: the rtc driver sometimes does not want to add the cdev. In order to accommodate this, the new cdev_device helper functions check dev->devt and if it's zero they don't add or delete the cdev.

* Remove prototypes for functions that were removed in the rtc driver

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16chardev: add helper function to register char devs with a struct devicefs/char_dev.c include/linux/cdev.h+91 -00 replies
2/16device-dax: fix cdev leakdrivers/dax/dax.c+11 -40 replies
3/16device-dax: utilize new cdev_device_add helper functiondrivers/dax/dax.c+5 -130 replies
4/16input: utilize new cdev_device_add helper functiondrivers/input/evdev.c drivers/input/joydev.c drivers/input/mousedev.c+6 -270 replies
5/16gpiolib: utilize new cdev_device_add helper functiondrivers/gpio/gpiolib.c+8 -150 replies
6/16tpm-chip: utilize new cdev_device_add helper functiondrivers/char/tpm/tpm-chip.c+3 -160 replies
7/16platform/chrome: cros_ec_dev - utilize new cdev_device_add helper functiondrivers/platform/chrome/cros_ec_dev.c+7 -240 replies
8/16IB/ucm: utilize new cdev_device_add helper functiondrivers/infiniband/core/ucm.c+18 -170 replies
9/16infiniband: utilize the new cdev_set_parent functiondrivers/infiniband/core/user_mad.c drivers/infiniband/core/uverbs_main.c drivers/infiniband/hw/hfi1/device.c+4 -40 replies
10/16iio:core: utilize new cdev_device_add helper functiondrivers/iio/industrialio-core.c+4 -110 replies
11/16media: utilize new cdev_device_add helper functiondrivers/media/cec/cec-core.c drivers/media/media-devnode.c+9 -270 replies
12/16mtd: utilize new cdev_device_add helper functiondrivers/mtd/ubi/build.c drivers/mtd/ubi/vmt.c+33 -1070 replies
13/16rapidio: utilize new cdev_device_add helper functiondrivers/rapidio/devices/rio_mport_cdev.c+8 -160 replies
14/16rtc: utilize new cdev_device_add helper functiondrivers/rtc/class.c drivers/rtc/rtc-core.h drivers/rtc/rtc-dev.c+10 -310 replies
15/16scsi: utilize new cdev_device_add helper functiondrivers/scsi/osd/osd_uld.c+20 -360 replies
16/16switchtec: utilize new device_add_cdev helper functiondrivers/pci/switch/switchtec.c+2 -90 replies

Reviews trailers per patch

9 of 16 patches have a Reviewed-by or Acked-by.

PatchHans VerkuilAlexandre BelloniJohannes ThumshirnDan WilliamsDmitry TorokhovLinus WalleijJason GunthorpeJarkko SakkinenLogan GunthorpeLeon Romanovsky
1/16R-b R-b
2/16R-b
3/16R-b R-b
4/16A-b
5/16R-b
6/16R-b R-b
7/16
8/16R-b R-b
9/16
10/16
11/16A-b
12/16
13/16
14/16A-b
15/16
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 10 reviewers.

Read the v5 thread

Cover letter [PATCH v5 00/16] Cleanup chardev instances with helper function

Hey,

This version of the series fixes the issue found by the kbuild test robot with the rtc driver. I managed to reproduce the issue and this series fixes the problem.

Logan

Changes since v4:

* Fix a kbuild robot issue with the rtc driver: the rtc driver sometimes does not want to add the cdev. In order to accommodate this, the new cdev_device helper functions check dev->devt and if it's zero they don't add or delete the cdev.

* Remove prototypes for functions that were removed in the rtc driver

Changes since v3:

* Added a missing "device.h" include which caused warnings with some build configurations

Changes since v2:

* Expanded comments as per Jason's suggestions
* Collected tags
* Updated the switchtec patch seeing it's underlying patch set changed

Changes since v1:

* Expanded the idea to take care of adding the cdev and the device

Logan

Dan Williams (1):
device-dax: fix cdev leak

Jason Gunthorpe (1):
IB/ucm: utilize new cdev_device_add helper function

Logan Gunthorpe (14):
chardev: add helper function to register char devs with a struct
device
device-dax: utilize new cdev_device_add helper function
input: utilize new cdev_device_add helper function
gpiolib: utilize new cdev_device_add helper function
tpm-chip: utilize new cdev_device_add helper function platform/chrome: cros_ec_dev - utilize new cdev_device_add helper
function
infiniband: utilize the new cdev_set_parent function iio:core: utilize new cdev_device_add helper function
media: utilize new cdev_device_add helper function
mtd: utilize new cdev_device_add helper function
rapidio: utilize new cdev_device_add helper function
rtc: utilize new cdev_device_add helper function
scsi: utilize new cdev_device_add helper function
switchtec: utilize new device_add_cdev helper function

 drivers/char/tpm/tpm-chip.c              | 19 ++-----
 drivers/dax/dax.c                        | 33 ++++++------
 drivers/gpio/gpiolib.c                   | 23 +++-----
 drivers/iio/industrialio-core.c          | 15 ++----
 drivers/infiniband/core/ucm.c            | 35 ++++++------
 drivers/infiniband/core/user_mad.c       |  4 +-
 drivers/infiniband/core/uverbs_main.c    |  2 +-
 drivers/infiniband/hw/hfi1/device.c      |  2 +-
 drivers/input/evdev.c                    | 11 +---
 drivers/input/joydev.c                   | 11 +---
 drivers/input/mousedev.c                 | 11 +---
 drivers/media/cec/cec-core.c             | 16 ++----
 drivers/media/media-devnode.c            | 20 ++-----
 drivers/mtd/ubi/build.c                  | 91 ++++++--------------------------
 drivers/mtd/ubi/vmt.c                    | 49 ++++++-----------
 drivers/pci/switch/switchtec.c           | 11 +---
 drivers/platform/chrome/cros_ec_dev.c    | 31 +++--------
 drivers/rapidio/devices/rio_mport_cdev.c | 24 +++------
 drivers/rtc/class.c                      | 14 +++--
 drivers/rtc/rtc-core.h                   | 10 ----
 drivers/rtc/rtc-dev.c                    | 17 ------
 drivers/scsi/osd/osd_uld.c               | 56 +++++++-------------
 fs/char_dev.c                            | 86 ++++++++++++++++++++++++++++++
 include/linux/cdev.h                     |  5 ++
 24 files changed, 239 insertions(+), 357 deletions(-)

--
2.1.4