mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Add subsys_i2c_driver() helpers and convert MFD I2C drivers
@ 2026-12-01  9:45 Peng Fan
  2026-12-01  9:45 ` [PATCH 1/2] i2c: add subsys_i2c_driver() macro Peng Fan
  2026-12-01  9:45 ` [PATCH 2/2] mfd: Convert to subsys_i2c_driver() Peng Fan
  0 siblings, 2 replies; 3+ messages in thread
From: Peng Fan @ 2026-12-01  9:45 UTC (permalink / raw)
  To: Andi Shyti, Lee Jones, Support Opensource, Charles Keepax,
	Richard Fitzgerald, Chanwoo Choi, Krzysztof Kozlowski,
	Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, Matti Vaittinen, Wolfram Sang
  Cc: linux-i2c, mfd, patches, linux-kernel, linux-omap, Peng Fan

Many I2C drivers open-code their own init/exit functions because they need
to be registered at the subsys_initcall() level when built in, which
prevents them from using module_i2c_driver(). The recently added
subsys_driver() and subsys_platform_driver() helpers address this for
platform drivers; this series adds the I2C equivalents and converts the
MFD users.

Patch 1 adds two macros in <linux/i2c.h>:

 - subsys_i2c_driver() for drivers that need an unregister path. It
   replaces the subsys_initcall()/module_exit() pair.

 - subsys_i2c_driver_probe() for drivers without an exit callback. It
   replaces a bare subsys_initcall().

Patch 2 converts 34 MFD driver files: some use subsys_i2c_driver() and
some use subsys_i2c_driver_probe(). The error messages around i2c_add_driver()
are dropped because registration failures are already reported by the
driver core, and initcall_debug can be used to see initcall return values.
No functional change is intended.

Because patch 2 depends on patch 1, I can resend the conversion after the
helper is merged, or the MFD maintainer can take both patches through an
immutable branch.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Peng Fan (2):
      i2c: add subsys_i2c_driver() macro
      mfd: Convert to subsys_i2c_driver()

 drivers/mfd/88pm800.c       | 13 +------------
 drivers/mfd/88pm805.c       | 13 +------------
 drivers/mfd/88pm860x-core.c | 18 +-----------------
 drivers/mfd/aat2870-core.c  |  7 +------
 drivers/mfd/act8945a.c      | 13 +------------
 drivers/mfd/as3711.c        |  7 +------
 drivers/mfd/da903x.c        | 13 +------------
 drivers/mfd/da9052-i2c.c    | 21 +--------------------
 drivers/mfd/da9055-i2c.c    | 21 +--------------------
 drivers/mfd/lm3533-core.c   | 13 +------------
 drivers/mfd/lochnagar-i2c.c | 13 +------------
 drivers/mfd/lp8788.c        | 13 +------------
 drivers/mfd/max77843.c      |  7 +------
 drivers/mfd/max8907.c       | 19 +------------------
 drivers/mfd/max8925-i2c.c   | 13 +------------
 drivers/mfd/max8997.c       |  7 +------
 drivers/mfd/max8998.c       |  7 +------
 drivers/mfd/mc13xxx-i2c.c   | 13 +------------
 drivers/mfd/palmas.c        | 13 +------------
 drivers/mfd/rc5t583.c       |  7 +------
 drivers/mfd/rohm-bd718x7.c  | 13 +------------
 drivers/mfd/rohm-bd96801.c  | 14 +-------------
 drivers/mfd/rsmu_i2c.c      | 13 +------------
 drivers/mfd/tc3589x.c       | 13 +------------
 drivers/mfd/tps6105x.c      | 13 +------------
 drivers/mfd/tps65010.c      | 15 +--------------
 drivers/mfd/tps6507x.c      | 13 +------------
 drivers/mfd/tps65090.c      |  7 +------
 drivers/mfd/tps65217.c      | 13 +------------
 drivers/mfd/tps6586x.c      | 13 +------------
 drivers/mfd/tps65910.c      |  7 +------
 drivers/mfd/wm831x-i2c.c    | 13 +------------
 drivers/mfd/wm8350-i2c.c    |  7 +------
 drivers/mfd/wm8400-core.c   | 15 +--------------
 include/linux/i2c.h         | 23 +++++++++++++++++++++++
 35 files changed, 57 insertions(+), 386 deletions(-)
---
base-commit: e5aad2bdbbee783611d32599f89cea3f12f9593d
change-id: 20261201-add-i2c-subsys-mfd-120cdb5f68a1

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>


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

end of thread, other threads:[~2026-12-01  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01  9:45 [PATCH 0/2] Add subsys_i2c_driver() helpers and convert MFD I2C drivers Peng Fan
2026-12-01  9:45 ` [PATCH 1/2] i2c: add subsys_i2c_driver() macro Peng Fan
2026-12-01  9:45 ` [PATCH 2/2] mfd: Convert to subsys_i2c_driver() Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®