From: Benjamin Herrenschmidt <b...@kernel.crashing.org>

As well as searching for nodes with type = "nvram", search for nodes
that have compatible = "nvram". This can't be converted into a single
call to of_find_compatible_node() with a non-NULL type, because that
searches for a node that has _both_ type & compatible = "nvram".

Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mich...@ellerman.id.au>
---
 arch/powerpc/sysdev/mmio_nvram.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/mmio_nvram.c b/arch/powerpc/sysdev/mmio_nvram.c
index 2073242..ddc877a 100644
--- a/arch/powerpc/sysdev/mmio_nvram.c
+++ b/arch/powerpc/sysdev/mmio_nvram.c
@@ -115,6 +115,8 @@ int __init mmio_nvram_init(void)
        int ret;
 
        nvram_node = of_find_node_by_type(NULL, "nvram");
+       if (!nvram_node)
+               nvram_node = of_find_compatible_node(NULL, NULL, "nvram");
        if (!nvram_node) {
                printk(KERN_WARNING "nvram: no node found in device-tree\n");
                return -ENODEV;
-- 
1.7.1

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to