ipmi/of: Don't use unavailable interfaces
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 6 Oct 2014 19:17:51 +0000 (14:17 -0500)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Oct 2014 17:22:32 +0000 (13:22 -0400)
If an IPMI controller is used by the firmware and as such marked with
a reserved status, we shouldn't use it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/ipmi/ipmi_si_intf.c

index 5d665680ae33fea5bbc74084d1d79d37f62c4f15..4fc89310bfb518176172433e3dbe4366d1c51427 100644 (file)
@@ -2658,6 +2658,9 @@ static int ipmi_probe(struct platform_device *dev)
        if (!match)
                return -EINVAL;
 
+       if (!of_device_is_available(np))
+               return -EINVAL;
+
        ret = of_address_to_resource(np, 0, &resource);
        if (ret) {
                dev_warn(&dev->dev, PFX "invalid address from OF\n");