linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/19] pinctrl/freescale: fix module usage in non-modular code
@ 2016-06-26  2:46 Paul Gortmaker
  2016-06-26  2:46 ` [PATCH 01/19] pinctrl: freescale: remove needless module.h include Paul Gortmaker
                   ` (18 more replies)
  0 siblings, 19 replies; 39+ messages in thread
From: Paul Gortmaker @ 2016-06-26  2:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Alexander Shiyan, Anson Huang, Denis Carikli,
	Dong Aisheng, Linus Walleij, Markus Pargmann, Shawn Guo,
	linux-gpio

This series covers the audit of non-modular module code use in the
drivers/pinctrl/freescale directory.  It has a few more commits than
I'd normally like in a single series, but fortunately the most of them
are dead simple.  That said, I can put the branch on kernel.org if
that makes life easier for merge processing, given the quantity.

FWIW, I originally had [locally] treated this whole Fsl directory as a
single patch, but upon reflection that didn't seem right either, given
the various authors, and the size of the combined changeset virtually
ensured that nobody Cc'd would genuinely review it all.  So 19 it is.

The changes in the drivers for #2-#16 inclusive are just removing the
module.h include, the unused exit function, and the no-op AUTHOR/LICENSE
tags with the occasional no-op MODULE_DEVICE_TABLE remove sprinkled in.

Only the imx23 and imx28 drivers still linked in a ".remove" function
(a shared one) and that usage is phased out in the patch #17 and #18,
where we also block sysfs unbind.  We get rid of the shared fcn in #19.

Quasi generic boiler plate description follows; included for folks who
haven't yet seen what we are aiming to achieve with this operation.

We are trying to not use module support for code that can never be built
as a module because:

 (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.

The freescale directory is a good example of #4, since all the
drivers seem to share a common heritage from one driver that had the
fundamental Kconfig vs. code mismatch originally (probably imx1).

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
   and/or export.h as required based on whether the file used it.

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

  -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 the driver.  [only imx23 and imx28]

There are no initcall level changes here; everything stays at the level
of initcall it was previously - either by not using modular versions to
begin with, or by using the builtin level equivalents.

As usual, we can consider making some of these tristate if the author
has strong feelings about extending support into the modular realm,
but I won't be able to run-time test any of that.

Build testing done on linux-next (on arm) as usual.

Paul.
---

Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: Anson Huang <Anson.Huang@freescale.com>
Cc: Denis Carikli <denis@eukrea.com>
Cc: Dong Aisheng <dong.aisheng@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Markus Pargmann <mpa@pengutronix.de>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: linux-gpio@vger.kernel.org

Paul Gortmaker (19):
  pinctrl: freescale: remove needless module.h include
  pinctrl: imx1: make it explicitly non-modular
  pinctrl: imx21: make it explicitly non-modular
  pinctrl: imx25: make it explicitly non-modular
  pinctrl: imx27: make it explicitly non-modular
  pinctrl: imx35: make it explicitly non-modular
  pinctrl: imx50: make it explicitly non-modular
  pinctrl: imx51: make it explicitly non-modular
  pinctrl: imx53: make it explicitly non-modular
  pinctrl: imx6dl: make it explicitly non-modular
  pinctrl: imx6q: make it explicitly non-modular
  pinctrl: imx6sl: make it explicitly non-modular
  pinctrl: imx6sx: make it explicitly non-modular
  pinctrl: imx6ul: make it explicitly non-modular
  pinctrl: imx7d: make it explicitly non-modular
  pinctrl: vf610: make it explicitly non-modular
  pinctrl: imx23: make it explicitly non-modular
  pinctrl: imx28: make it explicitly non-modular
  pinctrl: remove orphaned exported ".remove" function

 drivers/pinctrl/freescale/pinctrl-imx.c       |  1 -
 drivers/pinctrl/freescale/pinctrl-imx1-core.c |  1 -
 drivers/pinctrl/freescale/pinctrl-imx1.c      |  9 ++-------
 drivers/pinctrl/freescale/pinctrl-imx21.c     |  8 ++------
 drivers/pinctrl/freescale/pinctrl-imx23.c     | 17 ++++-------------
 drivers/pinctrl/freescale/pinctrl-imx25.c     | 10 ----------
 drivers/pinctrl/freescale/pinctrl-imx27.c     | 10 ----------
 drivers/pinctrl/freescale/pinctrl-imx28.c     | 17 ++++-------------
 drivers/pinctrl/freescale/pinctrl-imx35.c     | 10 ----------
 drivers/pinctrl/freescale/pinctrl-imx50.c     |  9 ---------
 drivers/pinctrl/freescale/pinctrl-imx51.c     | 10 ----------
 drivers/pinctrl/freescale/pinctrl-imx53.c     | 10 ----------
 drivers/pinctrl/freescale/pinctrl-imx6dl.c    | 14 +++-----------
 drivers/pinctrl/freescale/pinctrl-imx6q.c     | 10 ----------
 drivers/pinctrl/freescale/pinctrl-imx6sl.c    | 15 +++------------
 drivers/pinctrl/freescale/pinctrl-imx6sx.c    | 14 +++-----------
 drivers/pinctrl/freescale/pinctrl-imx6ul.c    | 14 +++-----------
 drivers/pinctrl/freescale/pinctrl-imx7d.c     | 14 +++-----------
 drivers/pinctrl/freescale/pinctrl-mxs.c       | 12 ------------
 drivers/pinctrl/freescale/pinctrl-mxs.h       |  1 -
 drivers/pinctrl/freescale/pinctrl-vf610.c     | 10 ----------
 21 files changed, 27 insertions(+), 189 deletions(-)

-- 
2.8.4

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2016-06-29  8:02 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-26  2:46 [PATCH 00/19] pinctrl/freescale: fix module usage in non-modular code Paul Gortmaker
2016-06-26  2:46 ` [PATCH 01/19] pinctrl: freescale: remove needless module.h include Paul Gortmaker
2016-06-29  7:30   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 02/19] pinctrl: imx1: make it explicitly non-modular Paul Gortmaker
2016-06-29  7:31   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 03/19] pinctrl: imx21: " Paul Gortmaker
2016-06-29  7:32   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 04/19] pinctrl: imx25: " Paul Gortmaker
2016-06-29  7:33   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 05/19] pinctrl: imx27: " Paul Gortmaker
2016-06-29  7:34   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 06/19] pinctrl: imx35: " Paul Gortmaker
2016-06-29  7:35   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 07/19] pinctrl: imx50: " Paul Gortmaker
2016-06-29  7:36   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 08/19] pinctrl: imx51: " Paul Gortmaker
2016-06-29  7:37   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 09/19] pinctrl: imx53: " Paul Gortmaker
2016-06-29  7:38   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 10/19] pinctrl: imx6dl: " Paul Gortmaker
2016-06-29  7:39   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 11/19] pinctrl: imx6q: " Paul Gortmaker
2016-06-29  7:49   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 12/19] pinctrl: imx6sl: " Paul Gortmaker
2016-06-29  7:50   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 13/19] pinctrl: imx6sx: " Paul Gortmaker
2016-06-29  7:51   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 14/19] pinctrl: imx6ul: " Paul Gortmaker
2016-06-29  7:52   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 15/19] pinctrl: imx7d: " Paul Gortmaker
2016-06-29  7:53   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 16/19] pinctrl: vf610: " Paul Gortmaker
2016-06-29  7:54   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 17/19] pinctrl: imx23: " Paul Gortmaker
2016-06-29  7:55   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 18/19] pinctrl: imx28: " Paul Gortmaker
2016-06-29  7:55   ` Linus Walleij
2016-06-26  2:46 ` [PATCH 19/19] pinctrl: remove orphaned exported ".remove" function Paul Gortmaker
2016-06-29  7:56   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).