From: Tony Lindgren <tony@atomide.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
paul@pwsan.com, Tero Kristo <t-kristo@ti.com>,
Nishanth Menon <nm@ti.com>
Subject: Re: [PATCHv4 06/10] ARM: OMAP: display: change compat names to array
Date: Wed, 3 Jun 2015 08:42:13 -0700 [thread overview]
Message-ID: <20150603154213.GO30984@atomide.com> (raw)
In-Reply-To: <1433139798-23450-7-git-send-email-tomi.valkeinen@ti.com>
* Tomi Valkeinen <tomi.valkeinen@ti.com> [150531 23:25]:
> Simplify the DSS detection logic by creating a list of the omapdss
> compat strings, instead of checking each separately with an 'if'.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tonY@atomide.com>
> ---
> arch/arm/mach-omap2/display.c | 29 ++++++++++++++---------------
> 1 file changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
> index f492ae147c6a..9868d0bc7805 100644
> --- a/arch/arm/mach-omap2/display.c
> +++ b/arch/arm/mach-omap2/display.c
> @@ -568,25 +568,24 @@ void __init omapdss_early_init_of(void)
>
> }
>
> +static const char * const omapdss_compat_names[] __initconst = {
> + "ti,omap2-dss",
> + "ti,omap3-dss",
> + "ti,omap4-dss",
> + "ti,omap5-dss",
> +};
> +
> struct device_node * __init omapdss_find_dss_of_node(void)
> {
> struct device_node *node;
> + int i;
>
> - node = of_find_compatible_node(NULL, NULL, "ti,omap2-dss");
> - if (node)
> - return node;
> -
> - node = of_find_compatible_node(NULL, NULL, "ti,omap3-dss");
> - if (node)
> - return node;
> -
> - node = of_find_compatible_node(NULL, NULL, "ti,omap4-dss");
> - if (node)
> - return node;
> -
> - node = of_find_compatible_node(NULL, NULL, "ti,omap5-dss");
> - if (node)
> - return node;
> + for (i = 0; i < ARRAY_SIZE(omapdss_compat_names); ++i) {
> + node = of_find_compatible_node(NULL, NULL,
> + omapdss_compat_names[i]);
> + if (node)
> + return node;
> + }
>
> return NULL;
> }
> --
> 2.1.4
>
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv4 06/10] ARM: OMAP: display: change compat names to array
Date: Wed, 3 Jun 2015 08:42:13 -0700 [thread overview]
Message-ID: <20150603154213.GO30984@atomide.com> (raw)
In-Reply-To: <1433139798-23450-7-git-send-email-tomi.valkeinen@ti.com>
* Tomi Valkeinen <tomi.valkeinen@ti.com> [150531 23:25]:
> Simplify the DSS detection logic by creating a list of the omapdss
> compat strings, instead of checking each separately with an 'if'.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tonY@atomide.com>
> ---
> arch/arm/mach-omap2/display.c | 29 ++++++++++++++---------------
> 1 file changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
> index f492ae147c6a..9868d0bc7805 100644
> --- a/arch/arm/mach-omap2/display.c
> +++ b/arch/arm/mach-omap2/display.c
> @@ -568,25 +568,24 @@ void __init omapdss_early_init_of(void)
>
> }
>
> +static const char * const omapdss_compat_names[] __initconst = {
> + "ti,omap2-dss",
> + "ti,omap3-dss",
> + "ti,omap4-dss",
> + "ti,omap5-dss",
> +};
> +
> struct device_node * __init omapdss_find_dss_of_node(void)
> {
> struct device_node *node;
> + int i;
>
> - node = of_find_compatible_node(NULL, NULL, "ti,omap2-dss");
> - if (node)
> - return node;
> -
> - node = of_find_compatible_node(NULL, NULL, "ti,omap3-dss");
> - if (node)
> - return node;
> -
> - node = of_find_compatible_node(NULL, NULL, "ti,omap4-dss");
> - if (node)
> - return node;
> -
> - node = of_find_compatible_node(NULL, NULL, "ti,omap5-dss");
> - if (node)
> - return node;
> + for (i = 0; i < ARRAY_SIZE(omapdss_compat_names); ++i) {
> + node = of_find_compatible_node(NULL, NULL,
> + omapdss_compat_names[i]);
> + if (node)
> + return node;
> + }
>
> return NULL;
> }
> --
> 2.1.4
>
next prev parent reply other threads:[~2015-06-03 15:42 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-01 6:23 [PATCHv4 00/10] ARM: DRA7: add display support Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
2015-06-01 6:23 ` [PATCHv4 01/10] arm: dra7: add DESHDCP clock Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
2015-06-02 6:56 ` Tero Kristo
2015-06-02 6:56 ` Tero Kristo
2015-06-01 6:23 ` [PATCHv4 02/10] CLK: TI: always enable " Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
2015-06-01 21:49 ` Tony Lindgren
2015-06-01 21:49 ` Tony Lindgren
2015-06-02 6:57 ` Tero Kristo
2015-06-02 6:57 ` Tero Kristo
2015-06-01 6:23 ` [PATCHv4 03/10] arm/dts: dra7xx: add 'ti,set-rate-parent' for dss_dss_clk Tomi Valkeinen
2015-06-01 6:23 ` [PATCHv4 03/10] arm/dts: dra7xx: add 'ti, set-rate-parent' " Tomi Valkeinen
2015-06-02 6:57 ` [PATCHv4 03/10] arm/dts: dra7xx: add 'ti,set-rate-parent' " Tero Kristo
2015-06-02 6:57 ` Tero Kristo
2015-06-01 6:23 ` [PATCHv4 04/10] ARM: DRA7: hwmod: add DMM hwmod description Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
2015-06-01 22:24 ` Paul Walmsley
2015-06-01 22:24 ` Paul Walmsley
2015-06-01 6:23 ` [PATCHv4 05/10] ARM: DRA7: hwmod: set DSS submodule parent hwmods Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
2015-06-01 22:26 ` Paul Walmsley
2015-06-01 22:26 ` Paul Walmsley
2015-06-01 6:23 ` [PATCHv4 06/10] ARM: OMAP: display: change compat names to array Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
2015-06-03 15:42 ` Tony Lindgren [this message]
2015-06-03 15:42 ` Tony Lindgren
2015-06-01 6:23 ` [PATCHv4 07/10] ARM: OMAP2+: display: detect DRA7 DSS Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
2015-06-03 15:42 ` Tony Lindgren
2015-06-03 15:42 ` Tony Lindgren
2015-06-01 6:23 ` [PATCHv4 08/10] arm/dts: dra7.dtsi: add DSS support Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
[not found] ` <1433139798-23450-9-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>
2015-06-03 15:43 ` Tony Lindgren
2015-06-03 15:43 ` Tony Lindgren
2015-06-01 6:23 ` [PATCHv4 09/10] arm/dts: dra72-evm.dts: add HDMI Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
2015-06-03 15:43 ` Tony Lindgren
2015-06-03 15:43 ` Tony Lindgren
2015-06-01 6:23 ` [PATCHv4 10/10] arm/dts: am57xx-beagle-x15.dts: " Tomi Valkeinen
2015-06-01 6:23 ` Tomi Valkeinen
[not found] ` <1433139798-23450-11-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>
2015-06-01 21:51 ` Tony Lindgren
2015-06-01 21:51 ` Tony Lindgren
[not found] ` <20150601215115.GH30984-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-06-02 6:28 ` Tomi Valkeinen
2015-06-02 6:28 ` Tomi Valkeinen
2015-06-03 11:26 ` Tomi Valkeinen
2015-06-03 11:26 ` Tomi Valkeinen
2015-06-03 15:44 ` Tony Lindgren
2015-06-03 15:44 ` Tony Lindgren
2015-06-03 16:01 ` Tomi Valkeinen
2015-06-03 16:01 ` Tomi Valkeinen
[not found] ` <556F24E6.7040003-l0cyMroinI0@public.gmane.org>
2015-06-03 16:10 ` Tony Lindgren
2015-06-03 16:10 ` Tony Lindgren
2015-06-03 17:16 ` Tony Lindgren
2015-06-03 17:16 ` Tony Lindgren
2015-06-04 6:13 ` Tomi Valkeinen
2015-06-04 6:13 ` Tomi Valkeinen
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=20150603154213.GO30984@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=paul@pwsan.com \
--cc=t-kristo@ti.com \
--cc=tomi.valkeinen@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.