[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140326113159.48c3c405@skate>
Date: Wed, 26 Mar 2014 11:31:59 +0100
From: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
To: Gregory CLEMENT <gregory.clement@...e-electrons.com>
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>, linux-pm@...r.kernel.org,
Jason Cooper <jason@...edaemon.net>,
Andrew Lunn <andrew@...n.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>,
linux-arm-kernel@...ts.infradead.org,
Lior Amsalem <alior@...vell.com>,
Tawfik Bayouk <tawfik@...vell.com>,
Nadav Haklai <nadavh@...vell.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 14/14] ARM: mvebu: register the cpuidle driver for
the Armada XP SoCs
Dear Gregory CLEMENT,
On Tue, 25 Mar 2014 23:48:25 +0100, Gregory CLEMENT wrote:
> +int __init armada_370_xp_cpu_pm_init(void)
> +{
> + if (!((of_find_compatible_node(NULL, NULL, "marvell,armada-370-xp-pmsu") ||
> + of_find_compatible_node(NULL, NULL, "marvell,armada-370-pmsu"))
> + && of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric")
> + && of_machine_is_compatible("marvell,armadaxp")))
> + return 0;
Instead of this big single condition, maybe it could be split in a
nicer way:
/*
* Check that all the requirements are available to enable
* cpuidle. So far, it is only supported on Armada XP, cpuidle
* needs the coherency fabric and the PMSU enabled
*/
if (!of_machine_is_compatible("marvell,armadaxp"))
return 0;
np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
if (!np)
return 0;
of_node_put(np);
np = of_find_matching_node(NULL, of_pmsu_table);
if (!np)
return 0;
of_node_put(np);
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists