PCI: mediatek: Advertise lack of built-in MSI handling
[linux-2.6-microblaze.git] / drivers / pci / controller / pcie-mediatek.c
index cf4c18f..9c10d87 100644 (file)
@@ -143,6 +143,7 @@ struct mtk_pcie_port;
  * struct mtk_pcie_soc - differentiate between host generations
  * @need_fix_class_id: whether this host's class ID needed to be fixed or not
  * @need_fix_device_id: whether this host's device ID needed to be fixed or not
+ * @no_msi: Bridge has no MSI support, and relies on an external block
  * @device_id: device ID which this host need to be fixed
  * @ops: pointer to configuration access functions
  * @startup: pointer to controller setting functions
@@ -151,6 +152,7 @@ struct mtk_pcie_port;
 struct mtk_pcie_soc {
        bool need_fix_class_id;
        bool need_fix_device_id;
+       bool no_msi;
        unsigned int device_id;
        struct pci_ops *ops;
        int (*startup)(struct mtk_pcie_port *port);
@@ -1035,14 +1037,14 @@ static int mtk_pcie_setup(struct mtk_pcie *pcie)
                err = of_pci_get_devfn(child);
                if (err < 0) {
                        dev_err(dev, "failed to parse devfn: %d\n", err);
-                       return err;
+                       goto error_put_node;
                }
 
                slot = PCI_SLOT(err);
 
                err = mtk_pcie_parse_port(pcie, child, slot);
                if (err)
-                       return err;
+                       goto error_put_node;
        }
 
        err = mtk_pcie_subsys_powerup(pcie);
@@ -1058,6 +1060,9 @@ static int mtk_pcie_setup(struct mtk_pcie *pcie)
                mtk_pcie_subsys_powerdown(pcie);
 
        return 0;
+error_put_node:
+       of_node_put(child);
+       return err;
 }
 
 static int mtk_pcie_probe(struct platform_device *pdev)
@@ -1084,6 +1089,7 @@ static int mtk_pcie_probe(struct platform_device *pdev)
 
        host->ops = pcie->soc->ops;
        host->sysdata = pcie;
+       host->msi_domain = pcie->soc->no_msi;
 
        err = pci_host_probe(host);
        if (err)
@@ -1173,6 +1179,7 @@ static const struct dev_pm_ops mtk_pcie_pm_ops = {
 };
 
 static const struct mtk_pcie_soc mtk_pcie_soc_v1 = {
+       .no_msi = true,
        .ops = &mtk_pcie_ops,
        .startup = mtk_pcie_startup_port,
 };