Commit 5fbba080 authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Jason Cooper

ARM: mvebu: ARM: mvebu: use of_find_matching_node_and_match() in coherency.c

In the mach-mvebu coherency code, instead of using
of_find_matching_node() and then of_match_node(), directly use the
of_find_matching_node_and_match() which does both at once.

We take this opportunity to also simplify the initialization of the
"type" variable.
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397483228-25625-5-git-send-email-thomas.petazzoni@free-electrons.comSigned-off-by: default avatarJason Cooper <jason@lakedaemon.net>
parent 5686a1e5
...@@ -148,14 +148,11 @@ static void __init armada_370_coherency_init(struct device_node *np) ...@@ -148,14 +148,11 @@ static void __init armada_370_coherency_init(struct device_node *np)
static int coherency_type(void) static int coherency_type(void)
{ {
struct device_node *np; struct device_node *np;
const struct of_device_id *match;
np = of_find_matching_node(NULL, of_coherency_table); np = of_find_matching_node_and_match(NULL, of_coherency_table, &match);
if (np) { if (np) {
const struct of_device_id *match = int type = (int) match->data;
of_match_node(of_coherency_table, np);
int type;
type = (int) match->data;
/* Armada 370/XP coherency works in both UP and SMP */ /* Armada 370/XP coherency works in both UP and SMP */
if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment