[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9b9d6d81-be16-4cbd-b691-6a7b16d85c4e@hartkopp.net>
Date: Fri, 28 Nov 2025 00:24:59 +0100
From: Oliver Hartkopp <socketcan@...tkopp.net>
To: Marc Kleine-Budde <mkl@...gutronix.de>
Cc: linux-can@...r.kernel.org, netdev@...r.kernel.org, davem@...emloft.net,
kuba@...nel.org, kernel@...gutronix.de, Vincent Mailhol <mailhol@...nel.org>
Subject: Re: [net-next] can: raw: fix build without CONFIG_CAN_DEV
Answering myself:
You were right (raw.c built-in, drivers as modules):
ld: net/can/raw.o: in function `raw_check_txframe':
/home/hartko/linux/net/can/raw.c:933:(.text+0xb2c): undefined reference
to `safe_candev_priv'
make[2]: *** [scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 1
make[1]: *** [/home/hartko/linux/Makefile:1242: vmlinux] Error 2
make: *** [Makefile:248: __sub-make] Error 2
Maybe its a better task for tomorrow ...
Sorry for the noise.
Best regards,
Oliver
On 28.11.25 00:03, Oliver Hartkopp wrote:
> Hello Marc,
>
> On 27.11.25 23:43, Marc Kleine-Budde wrote:
>> On 27.11.2025 23:35:48, Oliver Hartkopp wrote:
>>>> That's not sufficient. We can build the CAN_DEV as a module but compile
>>>> CAN_RAW into the kernel.
>>
>>> Oh, yes that's better.
>>
>> It's nicer, but it will not work if you build CAN_RAW into the kernel
>> and CAN_DEV as a module....Let me think of the right kconfig magic to
>> workaround this...
>
> No need for it IMO.
>
> I built my kernel with the CAN netlayer stuff into the kernel and
> disabled the CAN_DEV stuff.
>
> As you defined
>
> static inline struct can_priv *safe_candev_priv(struct net_device *dev) {
> return NULL;
> }
>
> in
>
> include/linux/can/dev.h
>
> this function is now inside raw.c which compiles excellent.
>
> Building without CONFIG_CAN_DEV is not a valid use-case anyway.
>
> It would only make sense, if someone wants to create an out-of-tree CAN
> driver without netlink ...
>
> Best regards,
> Oliver
>
>
Powered by blists - more mailing lists