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.
This commit is contained in:
Ian Lepore 2018-02-25 18:26:50 +00:00
parent beafe96147
commit f0a2d31ab1
3 changed files with 4 additions and 19 deletions

View File

@ -21,8 +21,4 @@ SUBDIR = \
smb \
smbus \
.if !empty(OPT_FDT)
SUBDIR += ofw_iicbus
.endif
.include <bsd.subdir.mk>

View File

@ -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>

View File

@ -1,15 +0,0 @@
# $FreeBSD$
.PATH: ${SRCTOP}/sys/dev/iicbus
KMOD= ofw_iicbus
SRCS= ofw_iicbus.c
SRCS+= \
bus_if.h \
device_if.h \
iicbus_if.h \
ofw_bus_if.h \
opt_platform.h \
.include <bsd.kmod.mk>