[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a3bDRvsTqtqxNp782OUy3e6Lib3eN3OSjjRh25x5Lkbuw@mail.gmail.com>
Date: Sun, 17 Jan 2021 11:21:47 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: Marek Vasut <marex@...x.de>, Lukas Wunner <lukas@...ner.de>,
Networking <netdev@...r.kernel.org>,
Andrew Lunn <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next V2] net: ks8851: Fix mixed module/builtin build
On Sat, Jan 16, 2021 at 10:41 PM Heiner Kallweit <hkallweit1@...il.com> wrote:
> >>
> >> 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
Powered by blists - more mailing lists