[RFC 0/3] gpio: move interfaces into their own files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus,

I was thinking of doing this since a while already but the recent discussion on
shared GPIOs made me think I should push this to you and see what you think.

Right now we have 3 different interfaces for GPIO:
- The core gpiod interface
- The legacy integer interface, which mostly relies on gpiod
- The sysfs interface, which relies on gpiod but should probably rely on the
  integer interface instead

This series separates the code for the interfaces into their own source file
and shares what needs to be through the private gpiolib.h header. Label support
is made mandatory in order to reduce the amount of things added into gpiolib.h.

Separating the code should make the various interfaces easier to grasp, and
will make it easier to implement interface-specific features. It also points
out some direct usages of descriptors/gpiolib core functions that should be
gotten rid of in order to make these real "consumers" of the gpiod interface.

This series has been tested and I'm fine with it being merged now if you agree
with the idea. It would probably be preferable from a cosmetic point of view to
first turn fix the extra consumers and then separate them so less things end up
being exported in gpiolib.h, but moving things first has the advantage of
clearly highlighting what needs to be done and spares us some rebasing hassle.

Alexandre Courbot (3):
  gpio: always compile label support
  gpio: move sysfs support to its own file
  gpio: move integer GPIO support to its own file

 drivers/gpio/Makefile         |    2 +
 drivers/gpio/gpiolib-legacy.c |  112 +++++
 drivers/gpio/gpiolib-sysfs.c  |  829 ++++++++++++++++++++++++++++++++
 drivers/gpio/gpiolib.c        | 1043 +----------------------------------------
 drivers/gpio/gpiolib.h        |   91 ++++
 5 files changed, 1040 insertions(+), 1037 deletions(-)
 create mode 100644 drivers/gpio/gpiolib-legacy.c
 create mode 100644 drivers/gpio/gpiolib-sysfs.c

-- 
2.0.0

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux