MLK-11780 PCI: imx: correct some type mistakes
authorRichard Zhu <hongxing.zhu@nxp.com>
Fri, 9 Mar 2018 05:50:29 +0000 (13:50 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:56:53 +0000 (14:56 -0500)
- They should be bitwise logic, not the boolean logic.
- Correct the error return values.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
drivers/pci/host/pci-imx6.c

index c482cd1..432c8de 100644 (file)
@@ -1938,22 +1938,22 @@ static irqreturn_t imx_pcie_dma_isr(int irq, void *param)
 
        /* check write isr */
        irqs = readl(pp->dbi_base + offset + DMA_WRITE_INT_STS);
-       if (irqs && DMA_DONE_INT_STS) {
+       if (irqs & DMA_DONE_INT_STS) {
                /* write 1 clear */
-               writel(irqs && DMA_DONE_INT_STS,
+               writel(irqs & DMA_DONE_INT_STS,
                                pp->dbi_base + offset + DMA_WRITE_INT_CLR);
                dma_w_end = 1;
-       } else if (irqs && DMA_ABORT_INT_STS) {
+       } else if (irqs & DMA_ABORT_INT_STS) {
                pr_info("imx pcie dma write error 0x%0x.\n", irqs);
        }
        /* check read isr */
        irqs = readl(pp->dbi_base + offset + DMA_READ_INT_STS);
-       if (irqs && DMA_DONE_INT_STS) {
+       if (irqs & DMA_DONE_INT_STS) {
                /* write 1 clear */
-               writel(irqs && DMA_DONE_INT_STS,
+               writel(irqs & DMA_DONE_INT_STS,
                                pp->dbi_base + offset + DMA_READ_INT_CLR);
                dma_r_end = 1;
-       } else if (irqs && DMA_ABORT_INT_STS) {
+       } else if (irqs & DMA_ABORT_INT_STS) {
                pr_info("imx pcie dma read error 0x%0x.", irqs);
        }
        return IRQ_HANDLED;
@@ -2405,14 +2405,14 @@ static int imx_pcie_probe(struct platform_device *pdev)
                        test_reg1 = devm_kzalloc(&pdev->dev,
                                        test_region_size, GFP_KERNEL);
                        if (!test_reg1) {
-                               ret = PTR_ERR(test_reg1);
+                               ret = -ENOMEM;
                                return ret;
                        }
 
                        test_reg2 = devm_kzalloc(&pdev->dev,
                                        test_region_size, GFP_KERNEL);
                        if (!test_reg2) {
-                               ret = PTR_ERR(test_reg1);
+                               ret = -ENOMEM;
                                return ret;
                        }
                }
@@ -2421,7 +2421,7 @@ static int imx_pcie_probe(struct platform_device *pdev)
                                        test_region_size);
                if (!pcie_arb_base_addr) {
                        dev_err(dev, "ioremap error in ep io test\n");
-                       ret = PTR_ERR(pcie_arb_base_addr);
+                       ret = -ENOMEM;
                        return ret;
                }