svn commit: r329988 - in head/sys/modules/i2c: . iicbus ofw_iicbus
Ian Lepore
ian at FreeBSD.org
Sun Feb 25 18:26:51 UTC 2018
Author: ian
Date: Sun Feb 25 18:26:50 2018
New Revision: 329988
URL: https://svnweb.freebsd.org/changeset/base/329988
Log:
Instead of building ofw_iicbus as a separate module, just compile it in to
the iicbus module for FDT-based systems.
The primary motivation for this is that host controller drivers which
declare DRIVER_MODULE(ofw_iicbus, thisdriver, etc, etc) now only need a
single MODULE_DEPEND(thisdriver, ofw_iicbus) for runtime linking to resolve
all the symbols. With ofw_iicbus and iicbus in separate modules, drivers
would need to declare a MODULE_DEPEND() on both, because symbol lookup is
non-recursive through the dependency chain. Requiring a driver to have
MODULE_DEPENDS() on both amounts to requiring the drivers to understand the
kobj inheritence details of how ofw_iicbus is implemented, which seems like
something they shouldn't have to know (and could even change some day).
Also, this is somewhat analogous to how the drivers get built when compiled
into the kernel. You don't have to ask for ofw_iicbus separately, it just
gets built in along with iicbus when option FDT is in effect.
Deleted:
head/sys/modules/i2c/ofw_iicbus/
Modified:
head/sys/modules/i2c/Makefile
head/sys/modules/i2c/iicbus/Makefile
Modified: head/sys/modules/i2c/Makefile
==============================================================================
--- head/sys/modules/i2c/Makefile Sun Feb 25 17:02:50 2018 (r329987)
+++ head/sys/modules/i2c/Makefile Sun Feb 25 18:26:50 2018 (r329988)
@@ -21,8 +21,4 @@ SUBDIR = \
smb \
smbus \
-.if !empty(OPT_FDT)
-SUBDIR += ofw_iicbus
-.endif
-
.include <bsd.subdir.mk>
Modified: head/sys/modules/i2c/iicbus/Makefile
==============================================================================
--- head/sys/modules/i2c/iicbus/Makefile Sun Feb 25 17:02:50 2018 (r329987)
+++ head/sys/modules/i2c/iicbus/Makefile Sun Feb 25 18:26:50 2018 (r329988)
@@ -14,4 +14,8 @@ SRCS= \
iiconf.c \
iiconf.h \
+.if !empty(OPT_FDT)
+SRCS+= ofw_iicbus.c ofw_bus_if.h
+.endif
+
.include <bsd.kmod.mk>
More information about the svn-src-all
mailing list