lkml.org 
[lkml]   [2021]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 0/7] Add PTP support for BCM53128 switch
From
Date
On 11/9/21 3:13 AM, Martin Kaistra wrote:
>
>
> Am 09.11.21 um 11:39 schrieb Vladimir Oltean:
>> On Tue, Nov 09, 2021 at 10:50:02AM +0100, Martin Kaistra wrote:
>>> Ideally, for the B53=m case, I would have liked to include the PTP
>>> support in the b53_module itself, however I couldn't find a way to do
>>> that without renaming either the common source file or the module, which
>>> I didn't want to do.
>>>
>>> Instead, b53_ptp will be allowed as a loadable module, but only if
>>> b53_common is also a module, otherwise it will be built-in.
>>
>> Does this not work?
>>
>> obj-$(CONFIG_B53)        += b53_common.o
>>
>> ifdef CONFIG_B53_PTP
>> b53_common-objs += b53_ptp.o
>> endif
>>
>> (haven't tried though)
>>
>
> I get:
>
> arm-linux-gnueabihf-ld  -EL    -r -o drivers/net/dsa/b53/b53_common.o
> drivers/net/dsa/b53/b53_ptp.o
>
>
>
> and
>
>
>
> ERROR: modpost: "b53_switch_register" [drivers/net/dsa/b53/b53_mdio.ko]
> undefined!
>
> ERROR: modpost: "b53_switch_alloc" [drivers/net/dsa/b53/b53_mdio.ko]
> undefined!
>
> ERROR: modpost: "b53_switch_register" [drivers/net/dsa/b53/b53_spi.ko]
> undefined!
>
> ERROR: modpost: "b53_switch_alloc" [drivers/net/dsa/b53/b53_spi.ko]
> undefined!
>
> It seems to me, that b53_common.c does not get included at all.

You need to play tricks with '-' and '_' and do something like this:

obj-$(CONFIG_B53) += b53-common.o

b53-common-objs += b53_common.o b53_ptp.o

and that should result in a b53-common.ko which would be accepted by
modprobe b53_common or b53-common AFAICT.
--
Florian

\
 
 \ /
  Last update: 2021-11-09 19:13    [W:0.084 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site