diff options
author | Richard Zhu <hongxing.zhu@nxp.com> | 2018-03-09 13:50:29 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 86ef779f0ab6003bc2b1f05ce2f11fa9ca2a4ec2 (patch) | |
tree | 48a026b3e1d971b790e5befa183989e99db4e0cb /drivers | |
parent | 799b615705972e576b2c7511abca0333bd36a605 (diff) |
MLK-11780 PCI: imx: correct some type mistakes
- They should be bitwise logic, not the boolean logic.
- Correct the error return values.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/host/pci-imx6.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index c482cd107e4d..432c8de16755 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -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; } |