Skip to content

mfd: demodularization of non-modular drivers

Paul Gortmaker linux-omap lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18mfd: stmpe-spi: Make it explicitly non-modulardrivers/mfd/stmpe-spi.c+2 -210 replies
2/18mfd: stmpe-i2c: Make it explicitly non-modulardrivers/mfd/stmpe-i2c.c drivers/mfd/stmpe.c drivers/mfd/stmpe.h+2 -360 replies
3/18mfd: ezx-pcap: Make it explicitly non-modulardrivers/mfd/ezx-pcap.c+3 -390 replies
4/18mfd: 88pm860x-*: Make it explicitly non-modulardrivers/mfd/88pm860x-core.c drivers/mfd/88pm860x-i2c.c+2 -390 replies
5/18mfd: tc3589: Make it explicitly non-modulardrivers/mfd/tc3589x.c+2 -240 replies
6/18mfd: tc6387xb: Make it explicitly non-modulardrivers/mfd/tc6387xb.c+4 -260 replies
7/18mfd: tc6393xb: Make it explicitly non-modulardrivers/mfd/tc6393xb.c+2 -410 replies
8/18mfd: twl4030-audio: Make it explicitly non-modulardrivers/mfd/twl4030-audio.c+3 -181 reply
9/18mfd: twl4030-power: Make it explicitly non-modulardrivers/mfd/twl4030-power.c+3 -160 replies
10/18mfd: twl6040: Make it explicitly non-modulardrivers/mfd/twl6040.c+3 -260 replies
11/18mfd: t7l66xb: Make it explicitly non-modulardrivers/mfd/t7l66xb.c+4 -330 replies
12/18mfd: lp8788: Make it explicitly non-modulardrivers/mfd/lp8788.c+2 -220 replies
13/18mfd: menelaus: Make it explicitly non-modulardrivers/mfd/menelaus.c+4 -200 replies
14/18mfd: tps6586x: Make it explicitly non-modulardrivers/mfd/tps6586x.c+2 -240 replies
15/18mfd: omap-usb-tll: Make it explicitly non-modulardrivers/mfd/omap-usb-tll.c+4 -430 replies
16/18mfd: omap-usb-host: Make it explicitly non-modulardrivers/mfd/omap-usb-host.c+5 -420 replies
17/18mfd: palmas: Make it explicitly non-modulardrivers/mfd/palmas.c+1 -350 replies
18/18mfd: intel_soc_pmic_core: Make it explicitly non-modulardrivers/mfd/intel_soc_pmic_core.c+3 -280 replies

Reviews trailers per patch

1 of 18 patches has a Reviewed-by or Acked-by.

PatchPeter Ujfalusi
1/18
2/18
3/18
4/18
5/18
6/18
7/18
8/18A-b
9/18
10/18
11/18
12/18
13/18
14/18
15/18
16/18
17/18
18/18

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/18] mfd: demodularization of non-modular drivers

This group of MFD drivers are all controlled by "bool" Kconfig settings, but contain module infrastructure like unused/orphaned "remove" and __exit functions, use of <linux/module.h> and/or MODULE_ macros that are no-ops in the non-modular case.

We can remove/replace all of the above. We are trying to make driver code consistent with the Makefiles/Kconfigs that control them. This means not using modular functions/macros for drivers that can never be built as a module. Some of the downfalls this leads to are:

(1) it is easy to accidentally write unused module_exit and remove code
(2) it can be misleading when reading the source, thinking it can be modular when the Makefile and/or Kconfig prohibit it
(3) it requires the include of the module.h header file which in turn includes nearly everything else, thus adding to CPP overhead.
(4) it gets copied/replicated into other drivers and spreads quickly.

We've integrated hundreds of these type cleanups already, as the git history will show. This is just a continuation of that objective.

The ".remove" function linked into the device structure deserves an extra comment. While the normal execution path would be from a module unload (if it was modular), it is theoretically possible that a person could use the core driver infrastructure to manually push the driver off the hardware; an "unbind" event -- which would run the ".remove" function.

Given that, in this series, when we delete a ".remove" function from the driver struct, we also disable unbind. Should there be a valid use case out there that has been overlooked, this will ensure we get to see it and can react/revert accordingly.

Build testing was done on drivers/mfd for allmodconfig on x86_64, ARM and ARM-64 (on linux-next).

---

Cc Alexandre Torgue <[email protected]>
Cc Daniel Ribeiro <[email protected]>
Cc Graeme Gregory <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc Harald Welte <[email protected]>
Cc Ian Molton <[email protected]>
Cc Jorge Eduardo Candelaria <[email protected]>
Cc Keshava Munegowda <[email protected]>
Cc Lee Jones <[email protected]>
Cc Maxime Coquelin <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Milo Kim <[email protected]>
Cc Misael Lopez Cruz <[email protected]>
Cc Peter Ujfalusi <[email protected]>
Cc Rabin Vincent <[email protected]>
Cc Roger Quadros <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Yang, Bin <[email protected]>
Cc Zhu, Lejun <[email protected]>

Paul Gortmaker (18):
mfd: stmpe-spi: Make it explicitly non-modular
mfd: stmpe-i2c: Make it explicitly non-modular
mfd: ezx-pcap: Make it explicitly non-modular
mfd: 88pm860x-*: Make it explicitly non-modular
mfd: tc3589: Make it explicitly non-modular
mfd: tc6387xb: Make it explicitly non-modular
mfd: tc6393xb: Make it explicitly non-modular
mfd: twl4030-audio: Make it explicitly non-modular
mfd: twl4030-power: Make it explicitly non-modular
mfd: twl6040: Make it explicitly non-modular
mfd: t7l66xb: Make it explicitly non-modular
mfd: lp8788: Make it explicitly non-modular
mfd: menelaus: Make it explicitly non-modular
mfd: tps6586x: Make it explicitly non-modular
mfd: omap-usb-tll: Make it explicitly non-modular
mfd: omap-usb-host: Make it explicitly non-modular
mfd: palmas: Make it explicitly non-modular
mfd: intel_soc_pmic_core: Make it explicitly non-modular

 drivers/mfd/88pm860x-core.c       | 40 ++-------------------------------
 drivers/mfd/88pm860x-i2c.c        |  1 -
 drivers/mfd/ezx-pcap.c            | 42 +++-------------------------------
 drivers/mfd/intel_soc_pmic_core.c | 31 +++-----------------------
 drivers/mfd/lp8788.c              | 24 ++------------------
 drivers/mfd/menelaus.c            | 24 ++++----------------
 drivers/mfd/omap-usb-host.c       | 47 +++++----------------------------------
 drivers/mfd/omap-usb-tll.c        | 47 ++++-----------------------------------
 drivers/mfd/palmas.c              | 36 +-----------------------------
 drivers/mfd/stmpe-i2c.c           | 23 ++-----------------
 drivers/mfd/stmpe-spi.c           | 23 ++-----------------
 drivers/mfd/stmpe.c               | 14 ------------
 drivers/mfd/stmpe.h               |  1 -
 drivers/mfd/t7l66xb.c             | 37 ++++--------------------------
 drivers/mfd/tc3589x.c             | 26 ++--------------------
 drivers/mfd/tc6387xb.c            | 30 ++++---------------------
 drivers/mfd/tc6393xb.c            | 43 ++---------------------------------
 drivers/mfd/tps6586x.c            | 26 ++--------------------
 drivers/mfd/twl4030-audio.c       | 21 +++--------------
 drivers/mfd/twl4030-power.c       | 19 +++-------------
 drivers/mfd/twl6040.c             | 29 +++---------------------
 21 files changed, 51 insertions(+), 533 deletions(-)
Signature · 1 line
2.7.4