mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Marc Kleine-Budde" <mkl@pengutronix.de>
Cc: "Vincent Mailhol" <mailhol@kernel.org>,
	"Arnd Bergmann" <arnd@kernel.org>,
	"Oliver Hartkopp" <socketcan@hartkopp.net>,
	"Jimmy Assarsson" <extja@kvaser.com>,
	linux-can@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: can: fix build dependency
Date: Wed, 10 Dec 2025 14:58:58 +0100	[thread overview]
Message-ID: <d2f80c97-55ab-4aac-a546-2d53ce29dd42@app.fastmail.com> (raw)
In-Reply-To: <20251210-sassy-apricot-toad-239179-mkl@pengutronix.de>

On Wed, Dec 10, 2025, at 10:38, Marc Kleine-Budde wrote:
> On 10.12.2025 10:10:27, Arnd Bergmann wrote:
>> On Wed, Dec 10, 2025, at 09:16, Marc Kleine-Budde wrote:
>>
>> Sorry I forgot to reply here: the '&& CAN' is absolutely
>> required here, otherwise you can configure CAN device drivers
>> as built-in with CAN_DEV=y CAN=m, and that results in a
>> link failure.
>
> You mean:
>
> | $ grep ^CONFIG_CAN .config
> | CONFIG_CAN=m
> | CONFIG_CAN_RAW=m
> | CONFIG_CAN_BCM=m
> | CONFIG_CAN_GW=m
> | CONFIG_CAN_DEV=y
> | CONFIG_CAN_VXCAN=y
> | CONFIG_CAN_NETLINK=y
> | CONFIG_CAN_CALC_BITTIMING=y
> | CONFIG_CAN_RX_OFFLOAD=y
> | CONFIG_CAN_DUMMY=y
> | CONFIG_CAN_GS_USB=y

Yes, I'm pretty sure I saw link failures with configurations
like this one.

> ...which works for me.

Looking at a random exported symbol from can_dev.ko, I see

obj-$(CONFIG_CAN) += can-dev.o
drivers/net/can/dev/dev.c:EXPORT_SYMBOL(can_hwtstamp_get);
drivers/net/can/usb/gs_usb.c:           return can_hwtstamp_get(netdev, cfg);

so in the configuration you list above, can-dev.ko is a
loadable module that exports can_hwtstamp_get, while gs_usb.o
is built-in and unable to link to that symbol.

       Arnd

      reply	other threads:[~2025-12-10 13:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 10:00 Arnd Bergmann
2025-12-04 18:03 ` Oliver Hartkopp
2025-12-04 23:30 ` Vincent Mailhol
2025-12-10  8:16   ` Marc Kleine-Budde
2025-12-10  9:10     ` Arnd Bergmann
2025-12-10  9:38       ` Marc Kleine-Budde
2025-12-10 13:58         ` Arnd Bergmann [this message]

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=d2f80c97-55ab-4aac-a546-2d53ce29dd42@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=extja@kvaser.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    /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

all inboxes | Powered by JetHome®