Skip to content

gpio: wean gpio/driver.h off of module.h

Paul Gortmaker linux-gpio linux-mips lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8gpio: palmas: fix implicit assumption module.h is presentdrivers/gpio/gpio-palmas.c+0 -11 reply
2/8gpio: sx150x: fix implicit assumption module.h is presentdrivers/gpio/gpio-sx150x.c+0 -21 reply
3/8gpio: ts4800: fix implicit assumption module.h is presentdrivers/gpio/gpio-ts4800.c+1 -01 reply
4/8gpio: altera: fix implicit assumption module.h is presentdrivers/gpio/gpio-altera.c+1 -01 reply
5/8gpio: ath79: fix implicit assumption module.h is presentdrivers/gpio/gpio-ath79.c+1 -01 reply
6/8gpio: loongson1: fix implicit assumption module.h is presentdrivers/gpio/gpio-loongson1.c+1 -01 reply
7/8gpio: wcove: fix implicit assumption module.h is presentdrivers/gpio/gpio-wcove.c+1 -01 reply
8/8gpio: don't include module.h in shared driver headerinclude/linux/gpio/driver.h+1 -11 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/8] gpio: wean gpio/driver.h off of module.h

Most shared headers in include/linux don't need to know what the internals of a struct module are; all they care about is that it is a struct and hence they may require a pointer to one.

The advantage in this is that module.h is including a lot of stuff itself, and an otherwise empty C file that just contains module.h will result in ~750kB from CPP (compared to say 12kB from init.h)

So we have approximately 50 instances of "struct module;" in the various include/linux headers already that help us keep module.h out of other headers; here we do the same for gpio.

But before we do, we fix up seven instances of code that were implicitly relying on this module.h so that we don't introduce build failures into the git history.

Some are tristate, so we just explicitly add module.h to them. The others are non-modular, so we just prune them off of the module based macros, so that module.h is no longer required to compile.

This series built on top of linux-next for arm, arm64, i386, x86_64 without any issues (allmodconfig).

---

Cc Ajay Thomas <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Bin Gao <[email protected]>
Cc Keguang Zhang <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mika Westerberg <[email protected]>

Paul Gortmaker (8):
gpio: palmas: fix implicit assumption module.h is present
gpio: sx150x: fix implicit assumption module.h is present
gpio: ts4800: fix implicit assumption module.h is present
gpio: altera: fix implicit assumption module.h is present
gpio: ath79: fix implicit assumption module.h is present
gpio: loongson1: fix implicit assumption module.h is present
gpio: wcove: fix implicit assumption module.h is present
gpio: don't include module.h in shared driver header

 drivers/gpio/gpio-altera.c    | 1 +
 drivers/gpio/gpio-ath79.c     | 1 +
 drivers/gpio/gpio-loongson1.c | 1 +
 drivers/gpio/gpio-palmas.c    | 1 -
 drivers/gpio/gpio-sx150x.c    | 2 --
 drivers/gpio/gpio-ts4800.c    | 1 +
 drivers/gpio/gpio-wcove.c     | 1 +
 include/linux/gpio/driver.h   | 2 +-
 8 files changed, 6 insertions(+), 4 deletions(-)
Signature · 1 line
2.8.4