ARM: mvebu: ARM: mvebu: use of_find_matching_node_and_match() in coherency.c
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 14 Apr 2014 13:47:02 +0000 (15:47 +0200)
committerJason Cooper <jason@lakedaemon.net>
Thu, 24 Apr 2014 05:00:36 +0000 (05:00 +0000)
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: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397483228-25625-5-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/mach-mvebu/coherency.c

index 296cf14f08a43665c6e20c5a240bde4f5f028dae..862100f7c8366810a815884494e5a52a916a4c26 100644 (file)
@@ -148,14 +148,11 @@ static void __init armada_370_coherency_init(struct device_node *np)
 static int coherency_type(void)
 {
        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) {
-               const struct of_device_id *match =
-                       of_match_node(of_coherency_table, np);
-               int type;
-
-               type = (int) match->data;
+               int type = (int) match->data;
 
                /* Armada 370/XP coherency works in both UP and SMP */
                if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP)