Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751829AbdH3BpJ (ORCPT ); Tue, 29 Aug 2017 21:45:09 -0400 Received: from mailgw02.mediatek.com ([218.249.47.111]:54951 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751318AbdH3BpH (ORCPT ); Tue, 29 Aug 2017 21:45:07 -0400 Message-ID: <1504057498.10964.13.camel@mhfsdcap03> Subject: Re: [PATCH] PCI: mediatek: take use of PCI_NUM_INTX From: Honghui Zhang To: CC: , , , , , , , , , , , , , , Date: Wed, 30 Aug 2017 09:44:58 +0800 In-Reply-To: <1504055954-31545-1-git-send-email-honghui.zhang@mediatek.com> References: <1504055954-31545-1-git-send-email-honghui.zhang@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1867 Lines: 50 On Wed, 2017-08-30 at 09:19 +0800, honghui.zhang@mediatek.com wrote: > From: Honghui Zhang > > Switch from using a custom NUM_INTX macro to the generic PCI_NUM_INTX > definition for the number of INTx interrupts. > > Signed-off-by: Honghui Zhang > --- > drivers/pci/host/pcie-mediatek.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > Hi, Bjorn, Ryder, this patch is based on Paul's v7 version of patch[1]("Move enum pci_interrupt_pin to linux/pci.h"). [1]http://www.spinics.net/lists/linux-pci/msg63891.html Thanks. > diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c > index c567996..5c0ce9b 100644 > --- a/drivers/pci/host/pcie-mediatek.c > +++ b/drivers/pci/host/pcie-mediatek.c > @@ -77,7 +77,6 @@ > #define PCIE_INT_MASK 0x420 > #define INTX_MASK GENMASK(19, 16) > #define INTX_SHIFT 16 > -#define INTX_NUM 4 > #define PCIE_INT_STATUS 0x424 > #define MSI_STATUS BIT(23) > #define PCIE_IMSI_STATUS 0x42c > @@ -576,7 +575,7 @@ static int mtk_pcie_init_irq_domain(struct mtk_pcie_port *port, > return -ENODEV; > } > > - port->irq_domain = irq_domain_add_linear(pcie_intc_node, INTX_NUM, > + port->irq_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX, > &intx_domain_ops, port); > if (!port->irq_domain) { > dev_err(dev, "failed to get INTx IRQ domain\n"); > @@ -594,7 +593,7 @@ static irqreturn_t mtk_pcie_intr_handler(int irq, void *data) > u32 bit = INTX_SHIFT; > > while ((status = readl(port->base + PCIE_INT_STATUS)) & INTX_MASK) { > - for_each_set_bit_from(bit, &status, INTX_NUM + INTX_SHIFT) { > + for_each_set_bit_from(bit, &status, PCI_NUM_INTX + INTX_SHIFT) { > /* Clear the INTx */ > writel(1 << bit, port->base + PCIE_INT_STATUS); > virq = irq_find_mapping(port->irq_domain,