Skip to contentSkip to conversation

gpiolib: split character device into gpiolib-cdev

PATCH Superseded Kent Gibson 2 participants 3 messages Jun 9, 2020 – Jun 16, 2020

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Kent Gibson

author reviewer
#0 lore raw

PATCH v3 1/1 gpiolib: split character device into gpiolib-cdev

Split the cdev specific functionality out of gpiolib.c and into gpiolib-cdev.c. This improves the readability and maintainability of both the cdev and core gpiolib code.

---

Changes in v3:
- updated the gpiolib-cdev.c file comment.
- rebased to latest gpio/devel (no changes impacted this patch)
- dropped the patch commentary as the points mentioned are mostly resolved - there still remain a couple of commits in gpio/fixes that will conflict...

 drivers/gpio/Makefile       |    1 +
 drivers/gpio/gpiolib-cdev.c | 1147 +++++++++++++++++++++++++++++++++++
 drivers/gpio/gpiolib-cdev.h |   11 +
 drivers/gpio/gpiolib.c      | 1112 +--------------------------------
 4 files changed, 1163 insertions(+), 1108 deletions(-)
 create mode 100644 drivers/gpio/gpiolib-cdev.c
 create mode 100644 drivers/gpio/gpiolib-cdev.h
drivers/gpio/Makefile +1 -0
index 1e4894e0bf0f..ef666cfef9d0 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_GPIOLIB)		+= gpiolib.o
 obj-$(CONFIG_GPIOLIB)		+= gpiolib-devres.o
 obj-$(CONFIG_GPIOLIB)		+= gpiolib-legacy.o
 obj-$(CONFIG_GPIOLIB)		+= gpiolib-devprop.o
+obj-$(CONFIG_GPIOLIB)		+= gpiolib-cdev.o
 obj-$(CONFIG_OF_GPIO)		+= gpiolib-of.o
 obj-$(CONFIG_GPIO_SYSFS)	+= gpiolib-sysfs.o
 obj-$(CONFIG_GPIO_ACPI)		+= gpiolib-acpi.o
drivers/gpio/gpiolib-cdev.c new file +1147 -0

1,147 lines not on this page · raw message

drivers/gpio/gpiolib-cdev.h new file +11 -0
new file mode 100644
index 000000000000..973578e7ad10
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef GPIOLIB_CDEV_H
+#define GPIOLIB_CDEV_H
+
+#include <linux/device.h>
+
+int gpiolib_cdev_register(struct gpio_device *gdev, dev_t devt);
+void gpiolib_cdev_unregister(struct gpio_device *gdev);
+
+#endif /* GPIOLIB_CDEV_H */
drivers/gpio/gpiolib.c +4 -1108

1,153 lines not on this page · raw message

base-commit: 74910e15ab25f95f162bc4d4a634d029186543ce

Signature · 1 line
2.27.0
#1 lore raw
Quoted 7 lines · Kent Gibson

Split the cdev specific functionality out of gpiolib.c and into gpiolib-cdev.c. This improves the readability and maintainability of both the cdev and core gpiolib code.

Quoted 8 lines

---

Changes in v3:
- updated the gpiolib-cdev.c file comment.
- rebased to latest gpio/devel (no changes impacted this patch)
- dropped the patch commentary as the points mentioned are mostly resolved - there still remain a couple of commits in gpio/fixes that will conflict...

I rebased my GPIO tree on v5.8-rc1 and the old version of the patch did not apply and neither did this, could you rebase this patch so I can apply it? Sorry for the moving target, the merge window times are a bit bumpy. :/

Yours,
Linus Walleij

author reviewer
#2 lore raw
Quoted 18 lines · Linus Walleij
Quoted 7 lines · Kent Gibson

Split the cdev specific functionality out of gpiolib.c and into gpiolib-cdev.c. This improves the readability and maintainability of both the cdev and core gpiolib code.

Quoted 8 lines

---

Changes in v3:
- updated the gpiolib-cdev.c file comment.
- rebased to latest gpio/devel (no changes impacted this patch)
- dropped the patch commentary as the points mentioned are mostly resolved - there still remain a couple of commits in gpio/fixes that will conflict...

Quoted 5 lines

I rebased my GPIO tree on v5.8-rc1 and the old version of the patch did not apply and neither did this, could you rebase this patch so I can apply it? Sorry for the moving target, the merge window times are a bit bumpy. :/

No problem - I was expecting a rebase to be in that patch's future from the beginning.

Give v4 a try.

Cheers,
Kent.