devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Murali Karicheri <m-karicheri2@ti.com>
Cc: David Miller <davem@davemloft.net>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v8 0/4] net: Add Keystone NetCP ethernet driver support
Date: Wed, 28 Jan 2015 22:03:09 +0100	[thread overview]
Message-ID: <20343006.1NmdQEM9nn@wuerfel> (raw)
In-Reply-To: <54C94A0D.9050505@ti.com>

On Wednesday 28 January 2015 15:43:57 Murali Karicheri wrote:
> > this. Hope I am on the right track.
> 
> Reproduced this. Following errors seen when building the modules.
> 
>    LD [M]  drivers/net/ethernet/ti/keystone_netcp.o
> drivers/net/ethernet/ti/netcp_ethss.o: In function `init_module':
> netcp_ethss.c:(.init.text+0x0): multiple definition of `init_module'
> drivers/net/ethernet/ti/netcp_core.o:netcp_core.c:(.init.text+0x0): 
> first defined here
> drivers/net/ethernet/ti/netcp_ethss.o: In function `cleanup_module':
> netcp_ethss.c:(.exit.text+0x0): multiple definition of `cleanup_module'
> drivers/net/ethernet/ti/netcp_core.o:netcp_core.c:(.exit.text+0x0): 
> first defined here
> make[4]: *** [drivers/net/ethernet/ti/keystone_netcp.o] Error 1
>
> BTW, I had to disable cpsw_ale.c to get to build keystone NetCP. I am 
> assuming someone from TI is addressing this.
> 
> drivers/net/ethernet/ti/cpsw_ale.c: In function ‘cpsw_ale_start’:
> drivers/net/ethernet/ti/cpsw_ale.c:759:2: error: ‘KBUILD_MODNAME’ 
> undeclared (first use in this function)
> drivers/net/ethernet/ti/cpsw_ale.c:759:2: note: each undeclared 
> identifier is reported only once for each function it appears in

I think both problems are nontrivial to fix. The first one is obviously
that there are multiple init_module functions in one module. You have
to either split the driver into multiple loadable modules with at most
one init_module/cleanup_module pair each, or call one of the functions
from the other one in the right order.

The second problem is where I got stuck myself: cpsw_ale.c (also cpts.c)
is getting linked into both modules, which is not allowed: It is
impossible for the kernel to compile these if one driver is a module
and the other one is not, and any use of KBUILD_MODNAME fails because
it is unclear what the modname is if the file is compiled once to
be linked into two drivers.

	Arnd

  reply	other threads:[~2015-01-28 21:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16  0:10 [PATCH net-next v8 0/4] net: Add Keystone NetCP ethernet driver support Murali Karicheri
     [not found] ` <1421367007-19744-1-git-send-email-m-karicheri2-l0cyMroinI0@public.gmane.org>
2015-01-19 20:11   ` David Miller
     [not found]     ` <20150119.151106.822126941934010309.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-01-20 15:53       ` Murali Karicheri
2015-01-27 22:28         ` Arnd Bergmann
2015-01-28 16:49           ` Murali Karicheri
2015-01-28 17:43             ` Murali Karicheri
2015-01-28 18:20               ` Murali Karicheri
2015-01-28 20:43                 ` Murali Karicheri
2015-01-28 21:03                   ` Arnd Bergmann [this message]
2015-01-28 22:40                     ` Murali Karicheri
     [not found]                       ` <54C9654C.8030407-l0cyMroinI0@public.gmane.org>
2015-01-29 17:21                         ` Murali Karicheri
2015-01-29 22:00                           ` Arnd Bergmann
2015-01-29 23:20                             ` Murali Karicheri
2015-01-29 23:49                               ` Arnd Bergmann

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=20343006.1NmdQEM9nn@wuerfel \
    --to=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --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).