Skip to content

Commit

Permalink
staging: gpib: Fix allyesconfig build failures
Browse files Browse the repository at this point in the history
My tests run an allyesconfig build and it failed with the following errors:

    LD [M]  samples/kfifo/dma-example.ko
  ld.lld: error: undefined symbol: nec7210_board_reset
  ld.lld: error: undefined symbol: nec7210_read
  ld.lld: error: undefined symbol: nec7210_write

It appears that some modules call the function nec7210_board_reset()
that is defined in nec7210.c.  In an allyesconfig build, these other
modules are built in.  But the file that holds nec7210_board_reset()
has:

  obj-m += nec7210.o

Where that "-m" means it only gets built as a module. With the other
modules built in, they have no access to nec7210_board_reset() and the build
fails.

This isn't the only function. After fixing that one, I hit another:

  ld.lld: error: undefined symbol: push_gpib_event
  ld.lld: error: undefined symbol: gpib_match_device_path

Where push_gpib_event() was also used outside of the file it was defined
in, and that file too only was built as a module.

Since the directory that nec7210.c is only traversed when
CONFIG_GPIB_NEC7210 is set, and the directory with gpib_common.c is only
traversed when CONFIG_GPIB_COMMON is set, use those configs as the
option to build those modules.  When it is an allyesconfig, then they
will both be built in and their functions will be available to the other
modules that are also built in.

Fixes: 3ba84ac ("staging: gpib: Add nec7210 GPIB chip driver")
Fixes: 9dde455 ("staging: gpib: Add GPIB common core driver")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
rostedt authored and torvalds committed Dec 21, 2024
1 parent a016546 commit e84a3bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/gpib/common/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

obj-m += gpib_common.o
obj-$(CONFIG_GPIB_COMMON) += gpib_common.o

gpib_common-objs := gpib_os.o iblib.o

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/gpib/nec7210/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

obj-m += nec7210.o
obj-$(CONFIG_GPIB_NEC7210) += nec7210.o


0 comments on commit e84a3bf

Please sign in to comment.