netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>, Marek Vasut <marex@denx.de>
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Lukas Wunner <lukas@wunner.de>
Subject: Re: [PATCH net-next] net: ks8851: Fix mixed module/builtin build
Date: Fri, 15 Jan 2021 18:22:12 +0100	[thread overview]
Message-ID: <48be7af4-3233-c3dc-70a1-1197b7ad83d7@gmail.com> (raw)
In-Reply-To: <YAG79tfQXTVWtPJX@lunn.ch>

On 15.01.2021 16:59, Andrew Lunn wrote:
> On Fri, Jan 15, 2021 at 04:05:57PM +0100, Marek Vasut wrote:
>> On 1/15/21 4:00 PM, Andrew Lunn wrote:
>>> On Fri, Jan 15, 2021 at 02:42:39PM +0100, Marek Vasut wrote:
>>>> When either the SPI or PAR variant is compiled as module AND the other
>>>> variant is compiled as built-in, the following build error occurs:
>>>>
>>>> arm-linux-gnueabi-ld: drivers/net/ethernet/micrel/ks8851_common.o: in function `ks8851_probe_common':
>>>> ks8851_common.c:(.text+0x1564): undefined reference to `__this_module'
>>>>
>>>> Fix this by including the ks8851_common.c in both ks8851_spi.c and
>>>> ks8851_par.c. The DEBUG macro is defined in ks8851_common.c, so it
>>>> does not have to be defined again.
>>>
>>> DEBUG should not be defined for production code. So i would remove it
>>> altogether.
>>>
>>> There is kconfig'ury you can use to make them both the same. But i'm
>>> not particularly good with it.
>>
>> We had discussion about this module/builtin topic in ks8851 before, so I was
>> hoping someone might provide a better suggestion.
> 
> Try Arnd Bergmann. He is good with this sort of thing.
> 
>     Andrew
> .
> 
I'd say make ks8851_common.c a separate module. Then, if one of SPI / PAR
is built in, ks8851_common needs to be built in too. To do so you'd have
export all symbols from ks8851_common that you want to use in SPI /PAR.

  parent reply	other threads:[~2021-01-15 17:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 13:42 [PATCH net-next] net: ks8851: Fix mixed module/builtin build Marek Vasut
2021-01-15 15:00 ` Andrew Lunn
2021-01-15 15:05   ` Marek Vasut
2021-01-15 15:59     ` Andrew Lunn
2021-01-15 16:08       ` Marek Vasut
2021-01-15 17:22       ` Heiner Kallweit [this message]
2021-01-15 21:36         ` Arnd Bergmann
2021-01-16 16:49           ` Marek Vasut
2021-01-15 19:51 ` kernel test robot
2021-01-15 19:51 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48be7af4-3233-c3dc-70a1-1197b7ad83d7@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=kuba@kernel.org \
    --cc=lukas@wunner.de \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).