From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: cpufreq: mediatek: allow modular build
Date: Fri, 11 Sep 2015 15:49:34 +0530 [thread overview]
Message-ID: <20150911101934.GP9650@linux> (raw)
In-Reply-To: <20150911101341.GN21084@n2100.arm.linux.org.uk>
On 11-09-15, 11:13, Russell King - ARM Linux wrote:
> Yes, but it's not that simple.
>
> A module with no module_init() and no module_exit() is what's called a
> library module, which can be inserted, and later removed provided no
> other module depends on anything the library module exports.
>
> A module with a module_init() but no module_exit() is one which can be
> inserted, but never removed.
>
> A module with a module_init() and a module_exit() can be inserted, and
> later removed in much the same way as the library module mentioned above.
>
> See kernel/module.c:
>
> /* If it has an init func, it must have an exit func to unload */
> if (mod->init && !mod->exit) {
> forced = try_force_unload(flags);
> if (!forced) {
> /* This module can't be removed */
> ret = -EBUSY;
> goto out;
> }
> }
>
> and
>
> if (mod->init != NULL && mod->exit == NULL) {
> printed_something = 1;
> seq_puts(m, "[permanent],");
> }
Thanks for that, really appreciate it.
And now I realize that Arnd was correct to start with :)
--
viresh
prev parent reply other threads:[~2015-09-11 10:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 8:15 cpufreq: mediatek: allow modular build Arnd Bergmann
2015-09-11 8:17 ` Viresh Kumar
2015-09-11 8:22 ` Arnd Bergmann
2015-09-11 8:25 ` Viresh Kumar
2015-09-11 8:36 ` Arnd Bergmann
2015-09-11 8:38 ` Viresh Kumar
2015-09-11 9:34 ` Russell King - ARM Linux
2015-09-11 9:40 ` Viresh Kumar
2015-09-11 9:58 ` Russell King - ARM Linux
2015-09-11 10:09 ` Viresh Kumar
2015-09-11 10:13 ` Russell King - ARM Linux
2015-09-11 10:19 ` Viresh Kumar [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=20150911101934.GP9650@linux \
--to=viresh.kumar@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).