Merge tag 'kconfig-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-microblaze.git] / drivers / parisc / lba_pci.c
index 69bd984..d470158 100644 (file)
@@ -49,6 +49,8 @@
 #include <asm/parisc-device.h>
 #include <asm/io.h>            /* read/write stuff */
 
+#include "iommu.h"
+
 #undef DEBUG_LBA       /* general stuff */
 #undef DEBUG_LBA_PORT  /* debug I/O Port access */
 #undef DEBUG_LBA_CFG   /* debug Config Space Access (ie PCI Bus walk) */
@@ -109,12 +111,10 @@ static u32 lba_t32;
 
 #define LBA_SKIP_PROBE(d) ((d)->flags & LBA_FLAG_SKIP_PROBE)
 
-
-/* Looks nice and keeps the compiler happy */
-#define LBA_DEV(d) ({                          \
-       void *__pdata = d;                      \
-       BUG_ON(!__pdata);                       \
-       (struct lba_device *)__pdata; })
+static inline struct lba_device *LBA_DEV(struct pci_hba_data *hba)
+{
+       return container_of(hba, struct lba_device, hba);
+}
 
 /*
 ** Only allow 8 subsidiary busses per LBA
@@ -1275,7 +1275,7 @@ lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
                r->flags = IORESOURCE_MEM;
                /* mmio_mask also clears Enable bit */
                r->start &= mmio_mask;
-               r->start = PCI_HOST_ADDR(HBA_DATA(lba_dev), r->start);
+               r->start = PCI_HOST_ADDR(&lba_dev->hba, r->start);
                rsize = ~ READ_REG32(lba_dev->hba.base_addr + LBA_LMMIO_MASK);
 
                /*
@@ -1321,7 +1321,7 @@ lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
                r->flags = IORESOURCE_MEM;
                /* mmio_mask also clears Enable bit */
                r->start &= mmio_mask;
-               r->start = PCI_HOST_ADDR(HBA_DATA(lba_dev), r->start);
+               r->start = PCI_HOST_ADDR(&lba_dev->hba, r->start);
                rsize = READ_REG32(lba_dev->hba.base_addr + LBA_ELMMIO_MASK);
                r->end = r->start + ~rsize;
        }
@@ -1562,7 +1562,7 @@ lba_driver_probe(struct parisc_device *dev)
 
        /* ------------ Second : initialize common stuff ---------- */
        pci_bios = &lba_bios_ops;
-       pcibios_register_hba(HBA_DATA(lba_dev));
+       pcibios_register_hba(&lba_dev->hba);
        spin_lock_init(&lba_dev->lba_lock);
 
        if (lba_hw_init(lba_dev))
@@ -1743,3 +1743,15 @@ static void quirk_diva_aux_disable(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
        quirk_diva_aux_disable);
+
+static void quirk_tosca_aux_disable(struct pci_dev *dev)
+{
+       if (dev->subsystem_vendor != PCI_VENDOR_ID_HP ||
+           dev->subsystem_device != 0x104a)
+               return;
+
+       dev_info(&dev->dev, "Hiding Tosca secondary built-in AUX serial device");
+       dev->device = 0;
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
+       quirk_tosca_aux_disable);