mirror of https://gitee.com/openkylin/linux.git
ARM: OMAP: display: change compat names to array
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>
This commit is contained in:
parent
a3818c6d57
commit
5b5992ac64
|
@ -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 * __init omapdss_find_dss_of_node(void)
|
||||||
{
|
{
|
||||||
struct device_node *node;
|
struct device_node *node;
|
||||||
|
int i;
|
||||||
|
|
||||||
node = of_find_compatible_node(NULL, NULL, "ti,omap2-dss");
|
for (i = 0; i < ARRAY_SIZE(omapdss_compat_names); ++i) {
|
||||||
if (node)
|
node = of_find_compatible_node(NULL, NULL,
|
||||||
return node;
|
omapdss_compat_names[i]);
|
||||||
|
if (node)
|
||||||
node = of_find_compatible_node(NULL, NULL, "ti,omap3-dss");
|
return node;
|
||||||
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;
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue