gpiolib: split character device into gpiolib-cdev
Kent Gibson
reviewerPATCH v4 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.
---
Changed in v4:
- rebased onto the latest gpio/devel (v5.8-rc1)
- squashed the "gpiolib: cdev: fix -Wmissing-prototypes warnings" patch so my "gpiolib: cdev: fixes for split from gpiolib.c" patch set can be disregarded.
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 | 1154 +++++++++++++++++++++++++++++++++++ drivers/gpio/gpiolib-cdev.h | 11 + drivers/gpio/gpiolib.c | 1119 +-------------------------------- 4 files changed, 1170 insertions(+), 1115 deletions(-) create mode 100644 drivers/gpio/gpiolib-cdev.c create mode 100644 drivers/gpio/gpiolib-cdev.h
drivers/gpio/Makefile +1 -0
@@ -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 +1154 -0
1,154 lines not on this page · raw message
drivers/gpio/gpiolib-cdev.h new file +11 -0
@@ -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 -1115
1,160 lines not on this page · raw message
base-commit: b3a9e3b9622ae10064826dccb4f7a52bd88c7407
Signature · 1 line
2.27.0
Quoted 9 lines · Kent Gibson
Split the cdev specific functionality out of
gpiolib.cand intogpiolib-cdev.c. This improves the readability and maintainability of both the cdev and core gpiolib code.Suggested-by Bartosz Golaszewski <[email protected]>Signed-off-by Kent Gibson <[email protected]>---
Changed in v4:
This v4 version applied for v5.9.
Yours,
Linus Walleij