Skip to content

memory: remove modular usage from non-modular drivers

Paul Gortmaker linux-omap linux-samsung-soc linux-tegra lkml 1 version Applied

Status from this message: Thanks, applied for v4.8.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 7 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6memory: atmel-sdramc: make it explicitly non-modulardrivers/memory/atmel-sdramc.c+4 -72 replies
2/6memory: mvebu-devbus: make it explicitly non-modulardrivers/memory/mvebu-devbus.c+4 -70 replies
3/6memory: omap-gpmc: make it explicitly non-modulardrivers/memory/omap-gpmc.c+0 -101 reply
4/6memory: tegra20-mc: make it explicitly non-modulardrivers/memory/tegra20-mc.c+4 -70 replies
5/6memory: samsung/exynos-srom: make it explicitly non-modulardrivers/memory/samsung/exynos-srom.c+3 -181 reply
6/6memory: atmel-ebi: make it explicitly non-modulardrivers/memory/atmel-ebi.c+2 -73 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchNicolas FerreBoris Brezillon
1/6A-b
2/6
3/6
4/6
5/6
6/6A-b A-b

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 0/6] memory: remove modular usage from non-modular drivers

It seems that drivers/memory/ doesn't have a single maintainer, so please feel free to pick up just one or two patches from this as appropriate.

For anyone new to the underlying goal of this cleanup, we are trying to not use module support for code that can never be built as a module since:

(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 code and spreads like weeds.

Changes seen here cover the following categories:

-just replacement of modular macros with their non-modular
equivalents that CPP would have inserted anyway

-the removal of including module.h ; replaced with init.h
as required based on whether the file already had it.

-the removal of any/all unused/orphaned __exit functions
that would never be called/exercised.

-the removal of any ".remove" functions that were hooked into
the driver struct. This ".remove" function would of
course not be called from the __exit function since that was never run. However in theory, someone could have triggered it via sysfs unbind, even though there isn't a sensible use case for doing so. So to cover that possibility, we've also disabled sysfs unbind in these drivers.

There are no initcall level changes here; everything continues to use the level of initcall it had before. So no risk of regressions from that exists here.

Build tested for several different key arch on a recent linux-next tree to ensure no silly typos crept in.

FAQ: Why not make it tristate?
------------------------------
Upon detecting a non-modular driver making modular references, I don't immediately convert them to tristate, since it increases functionality that I can't readily test, and it may not have a sensible use case (e.g. in the case of core arch support relating to timer ticks or similar.) So instead the modular references are removed w/o changing the existing functionality by default.

However there is no reason the original author or an interested user with the capability to test can't nominate a driver to be tristate either as the original intent, or as a functional and tested use case.

Paul.
---

Cc Alexandre Belloni <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Ezequiel Garcia <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Jean-Jacques Hiblot <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Nicolas Ferre <[email protected]>
Cc Pankaj Dubey <[email protected]>
Cc Roger Quadros <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Tony Lindgren <[email protected]>

Paul Gortmaker (6):
memory: atmel-sdramc: make it explicitly non-modular
memory: mvebu-devbus: make it explicitly non-modular
memory: omap-gpmc: make it explicitly non-modular
memory: tegra20-mc: make it explicitly non-modular
memory: samsung/exynos-srom: make it explicitly non-modular
memory: atmel-ebi: make it explicitly non-modular

 drivers/memory/atmel-ebi.c           |  9 ++-------
 drivers/memory/atmel-sdramc.c        | 11 ++++-------
 drivers/memory/mvebu-devbus.c        | 11 ++++-------
 drivers/memory/omap-gpmc.c           | 10 ----------
 drivers/memory/samsung/exynos-srom.c | 21 +++------------------
 drivers/memory/tegra20-mc.c          | 11 ++++-------
 6 files changed, 17 insertions(+), 56 deletions(-)
Signature · 1 line
2.8.4