From: giedrius.statkevicius@gmail.com (Giedrius Statkevičius)
To: kernelnewbies@lists.kernelnewbies.org
Subject: What is this MODULE_ALIAS() used for?
Date: Sat, 10 Dec 2016 10:40:56 +0200 [thread overview]
Message-ID: <CABNMmsD9g0YKcASZmzeOAkYZukVWWurJxHU19ko8Qy9r71RgoA@mail.gmail.com> (raw)
In-Reply-To: <158e6604a5b.daf47f044338.1522167468753623731@zoho.com>
On Sat, Dec 10, 2016 at 3:36 AM, Perr Zhang <strongbox8@zoho.com> wrote:
> source code:
>
> MODULE_ALIAS("platform:sm501");
>
> static const struct of_device_id of_sm501_match_tbl[] = {
> { .compatible = "smi,sm501", },
> { /* end */ }
> };
> MODULE_DEVICE_TABLE(of, of_sm501_match_tbl);
>
> location: http://lxr.free-electrons.com/source/drivers/mfd/sm501.c#L1711
>
> Since there is the MODULE_DEVICE_TABLE(), why the author additionally adds the MODULE_ALIAS()?
> What exactly is this MODULE_ALIAS() used for?
>
>
>
MODULE_ALIAS() adds some more info for the userspace programs. In
/lib/modules/VERSION/modules.alias you can see the aliases that were parsed from
the modules. In your case, running `modprobe platform:sm501` would insert the
sm501 module.
Thanks,
Giedrius
next prev parent reply other threads:[~2016-12-10 8:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-10 1:36 What is this MODULE_ALIAS() used for? Perr Zhang
2016-12-10 8:40 ` Giedrius Statkevičius [this message]
2016-12-14 13:01 ` Aruna Hewapathirane
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=CABNMmsD9g0YKcASZmzeOAkYZukVWWurJxHU19ko8Qy9r71RgoA@mail.gmail.com \
--to=giedrius.statkevicius@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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).