Thread (8 messages) flat view 8 messages, 4 authors, 2021-01-17

Re: [PATCH net-next V2] net: ks8851: Fix mixed module/builtin build

From: Arnd Bergmann <arnd@kernel.org>
Date: 2021-01-17 10:22:53

On Sat, Jan 16, 2021 at 10:41 PM Heiner Kallweit [off-list ref] wrote:
quoted
quoted
It seems unlikely that a system uses both, the parallel *and* the SPI
variant of the ks8851.  So the additional memory necessary because of
code duplication wouldn't matter in practice.
I have a board with both options populated on my desk, sorry.
Making the common part a separate module shouldn't be that hard.
AFAICS it would just take:
- export 4 functions from common
- extend Kconfig
- extend Makefile
One similar configuration that comes to my mind and could be used as
template is SPI_FSL_LIB.
There is no need to even change Kconfig, just simplify the Makefile to

obj-$(CONFIG_KS8851) += ks8851_common.o ks8851_spi.o
obj-$(CONFIG_KS8851_MLL) += ks8851_common.o ks8851_par.o

This will do the right thing and build ks8851_common.ko into
vmlinux if at least one of the two front-ends is built-in, and
otherwise build it at a loadable module if there is another
module using it.

         Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help