* [RFC PATCH 3.7.0-rc4 0/4] introduce of_simple_module_id_table macro
@ 2012-11-16 13:21 Srinivas KANDAGATLA
2012-11-20 16:45 ` Grant Likely
0 siblings, 1 reply; 3+ messages in thread
From: Srinivas KANDAGATLA @ 2012-11-16 13:21 UTC (permalink / raw)
To: grant.likely, rob.herring, viresh.linux, g.liakhovetski, ian,
thomas.ab
Cc: srinivas.kandagatla, spear-devel, linux-mmc, devicetree-discuss
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.
Am happy to run a script to generate cleanup patches for the hits,
However I would like to know your overall opinion on this type of patch.
Thanks,
srini
Srinivas Kandagatla (4):
of: introduce of_simple_module_id_table macro.
mm:exynos: use of_simple_module_id_table macro.
mm:sdhci-spear: use of_simple_module_id_table macro.
mm:shmobile: use of_simple_module_id_table macro.
drivers/mmc/host/dw_mmc-exynos.c | 7 +------
drivers/mmc/host/sdhci-spear.c | 8 +-------
drivers/mmc/host/sh_mobile_sdhi.c | 6 +-----
include/linux/of.h | 10 ++++++++++
4 files changed, 13 insertions(+), 18 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH 3.7.0-rc4 0/4] introduce of_simple_module_id_table macro
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
2012-11-28 10:33 ` Srinivas KANDAGATLA
0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2012-11-20 16:45 UTC (permalink / raw)
To: rob.herring, viresh.linux, g.liakhovetski, ian, thomas.ab
Cc: srinivas.kandagatla, spear-devel, linux-mmc, devicetree-discuss
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH 3.7.0-rc4 0/4] introduce of_simple_module_id_table macro
2012-11-20 16:45 ` Grant Likely
@ 2012-11-28 10:33 ` Srinivas KANDAGATLA
0 siblings, 0 replies; 3+ messages in thread
From: Srinivas KANDAGATLA @ 2012-11-28 10:33 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
On 20/11/12 16:45, Grant Likely wrote:
> On Fri, 16 Nov 2012 13:21:08 +0000, Srinivas KANDAGATLA <srinivas.kandagatla-qxv4g6HH51o@public.gmane.org> wrote:
>> From: Srinivas Kandagatla <srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
>>
>> 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?
I think adding data field is straight forward I will send a v2 of this
macro.
However adding variable number of table entries kills the very purpose
of this simple macro in the first-place.
>
> g.
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-28 10:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-11-28 10:33 ` Srinivas KANDAGATLA
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).