From: Al Viro <viro@ZenIV.linux.org.uk>
To: akpm@linux-foundation.org
Cc: jeff@garzik.org, netdev@vger.kernel.org, jkschind@gmail.com
Subject: Re: [patch 02/21] drivers/net/3c501.c: replace init_module&cleanup_module with module_init&module_exit
Date: Fri, 28 Mar 2008 21:58:17 +0000 [thread overview]
Message-ID: <20080328215817.GF10722@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20080328214755.GE10722@ZenIV.linux.org.uk>
On Fri, Mar 28, 2008 at 09:47:55PM +0000, Al Viro wrote:
> On Fri, Mar 28, 2008 at 02:41:16PM -0700, akpm@linux-foundation.org wrote:
>
> > Replace init_module and cleanup_module with static functions and
> > module_init/module_exit.
>
> Would the esteemed sir bother to build the resulting tree with drivers
> in question non-modular?
>
> Damnit, people, try to think for a minute. If these functions were
> not called directly in non-modular case, the driver would not work
> built-in. Which is not apriori impossible, but might warrant some
> further investigation. Use of grep, for starters...
Argh. My apologies for sloppiness of flame. Conclusion still stands.
* This conversion makes the modular-case init run in built-in case.
* Either driver does not work built-in, or we'd just gained duplicate
init for built-in.
* Built-in init would have to be non-static. Therefore, looking for
non-static functions in that sucker would be a good idea.
* The very first one is
* el1_probe: - probe for a 3c501
* @dev: The device structure passed in to probe.
*
* This can be called from two places. The network layer will probe using
* a device structure passed in with the probe information completed. For a
* modular driver we use #init_module to fill in our own structure and probe
* for it.
*
* Returns 0 on success. ENXIO if asked not to probe and ENODEV if asked to
* probe and failing to find anything.
*/
struct net_device * __init el1_probe(int unit)
* Explanatory comment aside, grep for el1_probe() in drivers/net
immediately shows that it *is* called from drivers/net/Space.c and yes,
with the patch in question you are a happy owner of messed probe/init
sequence. Looking at drivers/net/Space.c shows that it's called from
/* Statically configured drivers -- order matters here. */
static int __init net_olddevs_init(void)
and yes, it *does* matter - google for gory details, but it's very much
a "hang the box on blind probe in the wrong order" territory.
next prev parent reply other threads:[~2008-03-28 21:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 21:41 [patch 02/21] drivers/net/3c501.c: replace init_module&cleanup_module with module_init&module_exit akpm
2008-03-28 21:47 ` Al Viro
2008-03-28 21:58 ` Al Viro [this message]
2008-03-28 22:07 ` Andrew Morton
2008-03-28 22:23 ` Al Viro
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=20080328215817.GF10722@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=jeff@garzik.org \
--cc=jkschind@gmail.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).