From: Grant Likely <grant.likely@secretlab.ca>
To: rob.herring@calxeda.com, viresh.linux@gmail.com,
g.liakhovetski@gmx.de, ian@mnementh.co.uk, thomas.ab@samsung.com
Cc: srinivas.kandagatla@st.com, spear-devel@list.st.com,
linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [RFC PATCH 3.7.0-rc4 0/4] introduce of_simple_module_id_table macro
Date: Tue, 20 Nov 2012 16:45:31 +0000 [thread overview]
Message-ID: <20121120164531.8C8013E102F@localhost> (raw)
In-Reply-To: <1353072068-17758-1-git-send-email-srinivas.kandagatla@st.com>
On Fri, 16 Nov 2012 13:21:08 +0000, Srinivas KANDAGATLA <srinivas.kandagatla@st.com> wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
>
> This patch series introduces of_simple_module_id_table macro and as an example
> uses this macro in 3 files.
>
> Most of the device tree supported drivers have of_device_id table setup with
> single compatible entry, this use-case is very simple and common.
>
> #ifdef CONFIG_OF
> static struct of_device_id xxx_of_match[] = {
> { .compatible = "yyy,zzz" },
> { },
> };
> MODULE_DEVICE_TABLE(of, xxx_of_match);
> #endif
>
> This patch adds a macro for this simple type of device table.
> Other subsystems like pm, platform, have similar macros in kernel for
> simplest cases.
> Now the user can just replace the above code with
>
> of_simple_module_id_table(xxx_of_match, "yyy,zzz");
>
> There are more than 200+ hits for this type of pattern in the current kernel.
While I like the reduction in lines of source code, I'm not so fond of
the form. There is no easy way to extend the syntax for multiple
entries and it doesn't cover the frequently present .data field. Can you
think of a way to do this that can take a variable number of table
entries?
g.
next prev parent reply other threads:[~2012-11-20 16:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-16 13:21 [RFC PATCH 3.7.0-rc4 0/4] introduce of_simple_module_id_table macro Srinivas KANDAGATLA
2012-11-20 16:45 ` Grant Likely [this message]
2012-11-28 10:33 ` Srinivas KANDAGATLA
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=20121120164531.8C8013E102F@localhost \
--to=grant.likely@secretlab.ca \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=g.liakhovetski@gmx.de \
--cc=ian@mnementh.co.uk \
--cc=linux-mmc@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=spear-devel@list.st.com \
--cc=srinivas.kandagatla@st.com \
--cc=thomas.ab@samsung.com \
--cc=viresh.linux@gmail.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;
as well as URLs for NNTP newsgroup(s).