Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[firefly-linux-kernel-4.4.55.git] / arch / powerpc / platforms / pseries / pci.c
index c69bd15ced9c1497b8ec645e1ee11dbc8142464d..2c6ded29f73d3d5afbcdef6bd9719d777da0cd12 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/pci.h>
 #include <linux/string.h>
 
+#include <asm/eeh.h>
 #include <asm/pci-bridge.h>
 #include <asm/prom.h>
 #include <asm/ppc-pci.h>
@@ -39,7 +40,7 @@ void pcibios_name_device(struct pci_dev *dev)
         */
        dn = pci_device_to_OF_node(dev);
        if (dn) {
-               char *loc_code = get_property(dn, "ibm,loc-code", 0);
+               const char *loc_code = of_get_property(dn, "ibm,loc-code", 0);
                if (loc_code) {
                        int loc_len = strlen(loc_code);
                        if (loc_len < sizeof(dev->dev.name)) {
@@ -98,6 +99,10 @@ static void fixup_winbond_82c105(struct pci_dev* dev)
                if (dev->resource[i].flags & IORESOURCE_IO
                    && dev->bus->number == 0 && dev->devfn == 0x81)
                        dev->resource[i].flags &= ~IORESOURCE_IO;
+               if (dev->resource[i].start == 0 && dev->resource[i].end) {
+                       dev->resource[i].flags = 0;
+                       dev->resource[i].end = 0;
+               }
        }
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,