From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: David Miller <davem@davemloft.net>
Cc: nicolas.ferre@atmel.com, netdev@vger.kernel.org
Subject: Re: [PATCH] net/at91_ether: fix loading when macb is compiled as a module
Date: Sun, 16 Nov 2014 21:32:38 +0100 [thread overview]
Message-ID: <20141116203238.GL4656@sisyphus.hd.free.fr> (raw)
In-Reply-To: <20141116.135302.1339801219762777528.davem@davemloft.net>
On Sun, Nov 16, 2014 at 01:53:02PM -0500, David Miller wrote:
> From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> Date: Sun, 16 Nov 2014 19:05:06 +0100
>
> > The at91_ether driver depends on symbols defined in the macb driver.
> >
> > Currently, when compiling both at91_ether and macb as module, starting
> > the at91_ether module fails, because the macb module can not be loaded
> > with a macb interface.
> >
> > Avoid this issue by getting the macb module initialization routine to
> > always return 0, even when no macb device is detected.
> >
> > Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
>
> This is not acceptable, sorry.
>
> This means the module stays in memory even if nobody has a real use
> for it.
>
> You'll need to find another solution, and I'll say in passing that this
> was very poorly designed and that's why the problem exists.
>
Ok, I see multiple possible other fixes:
- inline the shared functions in the macb.h driver or move them to a
library, this effectively means duplication, but who is going to
enable both drivers anyway?
- when both drivers are compiled as module, make one module
containing both drivers say at91+macb.ko
- modify the code I posted so that it only keeps the macb driver
loaded without macb device if IS_ENABLED(CONFIG_ARM_AT91_ETHER)
and probably many others I do not see.
I just do not know which one you would find acceptable.
Regards.
--
Gilles.
prev parent reply other threads:[~2014-11-16 20:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-16 18:05 [PATCH] net/at91_ether: fix loading when macb is compiled as a module Gilles Chanteperdrix
2014-11-16 18:53 ` David Miller
2014-11-16 20:32 ` Gilles Chanteperdrix [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=20141116203238.GL4656@sisyphus.hd.free.fr \
--to=gilles.chanteperdrix@xenomai.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
/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