Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Ley Foon Tan <ley.foon.tan@intel.com>
To: Shawn Lin <shawn.lin@rock-chips.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v4 06/10] PCI: altera: Use pci_host_alloc_intx_irqd() helper to get irq domain for INTx
Date: Thu, 14 Jun 2018 18:51:21 +0800	[thread overview]
Message-ID: <1528973481.21961.0.camel@intel.com> (raw)
In-Reply-To: <1528940145-183495-1-git-send-email-shawn.lin@rock-chips.com>

On Thu, 2018-06-14 at 09:35 +0800, Shawn Lin wrote:
> Just avoid code duplication, but no functional change intended.
> 
> Cc: Ley Foon Tan <ley.foon.tan@intel.com>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
> ---
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  drivers/pci/controller/pcie-altera.c | 38 ++++--------------------
> ------------
>  1 file changed, 4 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-altera.c
> b/drivers/pci/controller/pcie-altera.c
> index 7d05e51..0915c8b 100644
> --- a/drivers/pci/controller/pcie-altera.c
> +++ b/drivers/pci/controller/pcie-altera.c
> @@ -443,19 +443,6 @@ static void altera_pcie_retrain(struct
> altera_pcie *pcie)
>  	}
>  }
>  
> -static int altera_pcie_intx_map(struct irq_domain *domain, unsigned
> int irq,
> -				irq_hw_number_t hwirq)
> -{
> -	irq_set_chip_and_handler(irq, &dummy_irq_chip,
> handle_simple_irq);
> -	irq_set_chip_data(irq, domain->host_data);
> -	return 0;
> -}
> -
> -static const struct irq_domain_ops intx_domain_ops = {
> -	.map = altera_pcie_intx_map,
> -	.xlate = pci_irqd_intx_xlate,
> -};
> -
>  static void altera_pcie_isr(struct irq_desc *desc)
>  {
>  	struct irq_chip *chip = irq_desc_get_chip(desc);
> @@ -519,22 +506,6 @@ static int
> altera_pcie_parse_request_of_pci_ranges(struct altera_pcie *pcie)
>  	return err;
>  }
>  
> -static int altera_pcie_init_irq_domain(struct altera_pcie *pcie)
> -{
> -	struct device *dev = &pcie->pdev->dev;
> -	struct device_node *node = dev->of_node;
> -
> -	/* Setup INTx */
> -	pcie->irq_domain = irq_domain_add_linear(node, PCI_NUM_INTX,
> -					&intx_domain_ops, pcie);
> -	if (!pcie->irq_domain) {
> -		dev_err(dev, "Failed to get a INTx IRQ domain\n");
> -		return -ENOMEM;
> -	}
> -
> -	return 0;
> -}
> -
>  static int altera_pcie_parse_dt(struct altera_pcie *pcie)
>  {
>  	struct device *dev = &pcie->pdev->dev;
> @@ -592,11 +563,10 @@ static int altera_pcie_probe(struct
> platform_device *pdev)
>  		return ret;
>  	}
>  
> -	ret = altera_pcie_init_irq_domain(pcie);
> -	if (ret) {
> -		dev_err(dev, "Failed creating IRQ Domain\n");
> -		return ret;
> -	}
> +	pcie->irq_domain = pci_host_alloc_intx_irqd(dev, pcie, true,
> NULL,
> +						    dev->of_node);
> +	if (IS_ERR(pcie->irq_domain))
> +		return PTR_ERR(pcie->irq_domain);
>  
>  	/* clear all interrupts */
>  	cra_writel(pcie, P2A_INT_STS_ALL, P2A_INT_STATUS);

  reply	other threads:[~2018-06-14  2:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14  1:33 [PATCH v4 0/10] Add new helper to allocate IRQ domain for host drivers Shawn Lin
2018-06-14  1:34 ` [PATCH v4 01/10] PCI: Add pci_host_alloc_intx_irqd() for allocating IRQ domain Shawn Lin
2018-06-14  7:09   ` Thomas Petazzoni
2018-07-19 11:37     ` Lorenzo Pieralisi
2018-06-14  1:34 ` [PATCH v4 02/10] PCI: dra7xx: Use pci_host_alloc_intx_irqd() helper to simplify the code Shawn Lin
2018-06-14  1:34 ` [PATCH v4 03/10] PCI: keystone-dw: Use pci_host_alloc_intx_irqd() helper to get irq domain for INTx Shawn Lin
2018-06-14  1:35 ` [PATCH v4 04/10] PCI: aardvark: " Shawn Lin
2018-06-14  1:35 ` [PATCH v4 05/10] PCI: faraday: " Shawn Lin
2018-06-14  1:35 ` [PATCH v4 06/10] PCI: altera: " Shawn Lin
2018-06-14 10:51   ` Ley Foon Tan [this message]
2018-06-14  1:36 ` [PATCH v4 07/10] PCI: mediatek: " Shawn Lin
2018-06-14  1:36 ` [PATCH v4 08/10] PCI: xilinx-nwl: " Shawn Lin
2018-06-14  1:36 ` [PATCH v4 09/10] PCI: xilinx: " Shawn Lin
2018-06-14  1:36 ` [PATCH v4 10/10] PCI: rockchip: " Shawn Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1528973481.21961.0.camel@intel.com \
    --to=ley.foon.tan@intel.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=shawn.lin@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox