PCI: mobiveil: Fix error return values
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Fri, 5 Jul 2019 09:56:44 +0000 (17:56 +0800)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 8 Jul 2019 11:28:44 +0000 (12:28 +0100)
Some error return values in the host controller driver are
either unconventional or plain wrong. Update them all with
the expected return values.

Signed-off-by: Hou Zhiqiang <Zhinqiang.Hou@nxp.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Minghuan Lian <Minghuan.Lian@nxp.com>
Reviewed-by: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>
drivers/pci/controller/pcie-mobiveil.c

index 965f89a..51cbe53 100644 (file)
@@ -822,7 +822,7 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie)
 
        if (!pcie->intx_domain) {
                dev_err(dev, "Failed to get a INTx IRQ domain\n");
-               return -ENODEV;
+               return -ENOMEM;
        }
 
        raw_spin_lock_init(&pcie->intx_mask_lock);
@@ -848,7 +848,7 @@ static int mobiveil_pcie_probe(struct platform_device *pdev)
        /* allocate the PCIe port */
        bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
        if (!bridge)
-               return -ENODEV;
+               return -ENOMEM;
 
        pcie = pci_host_bridge_priv(bridge);
        if (!pcie)
@@ -869,7 +869,7 @@ static int mobiveil_pcie_probe(struct platform_device *pdev)
                                                    &pcie->resources, &iobase);
        if (ret) {
                dev_err(dev, "Getting bridge resources failed\n");
-               return -ENOMEM;
+               return ret;
        }
 
        /*