mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 05:34:00 +08:00
PCI/keystone: Use irq_data_get_msi_desc() to avoid redundant lookup of irq_data
Use irq_data_get_msi_desc() to avoid redundant lookup of irq_data while we already have a pointer to corresponding irq_data. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Murali Karicheri <m-karicheri2@ti.com> Cc: linux-pci@vger.kernel.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
507a883ed5
commit
40b6d3faef
@ -104,14 +104,13 @@ static void ks_dw_pcie_msi_irq_ack(struct irq_data *d)
|
||||
{
|
||||
u32 offset, reg_offset, bit_pos;
|
||||
struct keystone_pcie *ks_pcie;
|
||||
unsigned int irq = d->irq;
|
||||
struct msi_desc *msi;
|
||||
struct pcie_port *pp;
|
||||
|
||||
msi = irq_get_msi_desc(irq);
|
||||
msi = irq_data_get_msi_desc(d);
|
||||
pp = sys_to_pcie(msi->dev->bus->sysdata);
|
||||
ks_pcie = to_keystone_pcie(pp);
|
||||
offset = irq - irq_linear_revmap(pp->irq_domain, 0);
|
||||
offset = d->irq - irq_linear_revmap(pp->irq_domain, 0);
|
||||
update_reg_offset_bit_pos(offset, ®_offset, &bit_pos);
|
||||
|
||||
writel(BIT(bit_pos),
|
||||
@ -142,15 +141,14 @@ void ks_dw_pcie_msi_clear_irq(struct pcie_port *pp, int irq)
|
||||
static void ks_dw_pcie_msi_irq_mask(struct irq_data *d)
|
||||
{
|
||||
struct keystone_pcie *ks_pcie;
|
||||
unsigned int irq = d->irq;
|
||||
struct msi_desc *msi;
|
||||
struct pcie_port *pp;
|
||||
u32 offset;
|
||||
|
||||
msi = irq_get_msi_desc(irq);
|
||||
msi = irq_data_get_msi_desc(d);
|
||||
pp = sys_to_pcie(msi->dev->bus->sysdata);
|
||||
ks_pcie = to_keystone_pcie(pp);
|
||||
offset = irq - irq_linear_revmap(pp->irq_domain, 0);
|
||||
offset = d->irq - irq_linear_revmap(pp->irq_domain, 0);
|
||||
|
||||
/* Mask the end point if PVM implemented */
|
||||
if (IS_ENABLED(CONFIG_PCI_MSI)) {
|
||||
@ -164,15 +162,14 @@ static void ks_dw_pcie_msi_irq_mask(struct irq_data *d)
|
||||
static void ks_dw_pcie_msi_irq_unmask(struct irq_data *d)
|
||||
{
|
||||
struct keystone_pcie *ks_pcie;
|
||||
unsigned int irq = d->irq;
|
||||
struct msi_desc *msi;
|
||||
struct pcie_port *pp;
|
||||
u32 offset;
|
||||
|
||||
msi = irq_get_msi_desc(irq);
|
||||
msi = irq_data_get_msi_desc(d);
|
||||
pp = sys_to_pcie(msi->dev->bus->sysdata);
|
||||
ks_pcie = to_keystone_pcie(pp);
|
||||
offset = irq - irq_linear_revmap(pp->irq_domain, 0);
|
||||
offset = d->irq - irq_linear_revmap(pp->irq_domain, 0);
|
||||
|
||||
/* Mask the end point if PVM implemented */
|
||||
if (IS_ENABLED(CONFIG_PCI_MSI)) {
|
||||
|
Loading…
Reference in New Issue
Block a user