diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2016-10-06 14:36:56 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-10-11 23:56:46 -0400 |
commit | 5649e4ced9671e01bdb1f50b2b5987d44c9a6d3d (patch) | |
tree | d3b35795070910b180c0aa06242ed8b322a04b6b /drivers/pci/host | |
parent | f3eca6c4f42dc2dc057d6ef5d7dae1a5307f4f9f (diff) |
PCI: keystone: Pass keystone_pcie, not address, to IRQ functions
Instead of passing the application register base to IRQ functions,
pass the struct keystone_pcie. This will allow them to use register
accessors. No functional change intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/host')
-rw-r--r-- | drivers/pci/host/pci-keystone-dw.c | 15 | ||||
-rw-r--r-- | drivers/pci/host/pci-keystone.c | 5 | ||||
-rw-r--r-- | drivers/pci/host/pci-keystone.h | 5 |
3 files changed, 12 insertions, 13 deletions
diff --git a/drivers/pci/host/pci-keystone-dw.c b/drivers/pci/host/pci-keystone-dw.c index ce97816f5d64..dae68a230440 100644 --- a/drivers/pci/host/pci-keystone-dw.c +++ b/drivers/pci/host/pci-keystone-dw.c | |||
@@ -261,25 +261,26 @@ void ks_dw_pcie_handle_legacy_irq(struct keystone_pcie *ks_pcie, int offset) | |||
261 | writel(offset, ks_pcie->va_app_base + IRQ_EOI); | 261 | writel(offset, ks_pcie->va_app_base + IRQ_EOI); |
262 | } | 262 | } |
263 | 263 | ||
264 | void ks_dw_pcie_enable_error_irq(void __iomem *reg_base) | 264 | void ks_dw_pcie_enable_error_irq(struct keystone_pcie *ks_pcie) |
265 | { | 265 | { |
266 | writel(ERR_IRQ_ALL, reg_base + ERR_IRQ_ENABLE_SET); | 266 | writel(ERR_IRQ_ALL, ks_pcie->va_app_base + ERR_IRQ_ENABLE_SET); |
267 | } | 267 | } |
268 | 268 | ||
269 | irqreturn_t ks_dw_pcie_handle_error_irq(struct device *dev, | 269 | irqreturn_t ks_dw_pcie_handle_error_irq(struct keystone_pcie *ks_pcie) |
270 | void __iomem *reg_base) | ||
271 | { | 270 | { |
272 | u32 status; | 271 | u32 status; |
273 | 272 | ||
274 | status = readl(reg_base + ERR_IRQ_STATUS_RAW) & ERR_IRQ_ALL; | 273 | status = readl(ks_pcie->va_app_base + ERR_IRQ_STATUS_RAW) & |
274 | ERR_IRQ_ALL; | ||
275 | if (!status) | 275 | if (!status) |
276 | return IRQ_NONE; | 276 | return IRQ_NONE; |
277 | 277 | ||
278 | if (status & ERR_FATAL_IRQ) | 278 | if (status & ERR_FATAL_IRQ) |
279 | dev_err(dev, "fatal error (status %#010x)\n", status); | 279 | dev_err(ks_pcie->pp.dev, "fatal error (status %#010x)\n", |
280 | status); | ||
280 | 281 | ||
281 | /* Ack the IRQ; status bits are RW1C */ | 282 | /* Ack the IRQ; status bits are RW1C */ |
282 | writel(status, reg_base + ERR_IRQ_STATUS); | 283 | writel(status, ks_pcie->va_app_base + ERR_IRQ_STATUS); |
283 | return IRQ_HANDLED; | 284 | return IRQ_HANDLED; |
284 | } | 285 | } |
285 | 286 | ||
diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c index 9dfac0bf3554..043c19a05da1 100644 --- a/drivers/pci/host/pci-keystone.c +++ b/drivers/pci/host/pci-keystone.c | |||
@@ -237,7 +237,7 @@ static void ks_pcie_setup_interrupts(struct keystone_pcie *ks_pcie) | |||
237 | } | 237 | } |
238 | 238 | ||
239 | if (ks_pcie->error_irq > 0) | 239 | if (ks_pcie->error_irq > 0) |
240 | ks_dw_pcie_enable_error_irq(ks_pcie->va_app_base); | 240 | ks_dw_pcie_enable_error_irq(ks_pcie); |
241 | } | 241 | } |
242 | 242 | ||
243 | /* | 243 | /* |
@@ -305,8 +305,7 @@ static irqreturn_t pcie_err_irq_handler(int irq, void *priv) | |||
305 | { | 305 | { |
306 | struct keystone_pcie *ks_pcie = priv; | 306 | struct keystone_pcie *ks_pcie = priv; |
307 | 307 | ||
308 | return ks_dw_pcie_handle_error_irq(ks_pcie->pp.dev, | 308 | return ks_dw_pcie_handle_error_irq(ks_pcie); |
309 | ks_pcie->va_app_base); | ||
310 | } | 309 | } |
311 | 310 | ||
312 | static int __init ks_add_pcie_port(struct keystone_pcie *ks_pcie, | 311 | static int __init ks_add_pcie_port(struct keystone_pcie *ks_pcie, |
diff --git a/drivers/pci/host/pci-keystone.h b/drivers/pci/host/pci-keystone.h index a5b0cb2ba4d7..fe2f741739c2 100644 --- a/drivers/pci/host/pci-keystone.h +++ b/drivers/pci/host/pci-keystone.h | |||
@@ -45,9 +45,8 @@ phys_addr_t ks_dw_pcie_get_msi_addr(struct pcie_port *pp); | |||
45 | /* Keystone specific PCI controller APIs */ | 45 | /* Keystone specific PCI controller APIs */ |
46 | void ks_dw_pcie_enable_legacy_irqs(struct keystone_pcie *ks_pcie); | 46 | void ks_dw_pcie_enable_legacy_irqs(struct keystone_pcie *ks_pcie); |
47 | void ks_dw_pcie_handle_legacy_irq(struct keystone_pcie *ks_pcie, int offset); | 47 | void ks_dw_pcie_handle_legacy_irq(struct keystone_pcie *ks_pcie, int offset); |
48 | void ks_dw_pcie_enable_error_irq(void __iomem *reg_base); | 48 | void ks_dw_pcie_enable_error_irq(struct keystone_pcie *ks_pcie); |
49 | irqreturn_t ks_dw_pcie_handle_error_irq(struct device *dev, | 49 | irqreturn_t ks_dw_pcie_handle_error_irq(struct keystone_pcie *ks_pcie); |
50 | void __iomem *reg_base); | ||
51 | int ks_dw_pcie_host_init(struct keystone_pcie *ks_pcie, | 50 | int ks_dw_pcie_host_init(struct keystone_pcie *ks_pcie, |
52 | struct device_node *msi_intc_np); | 51 | struct device_node *msi_intc_np); |
53 | int ks_dw_pcie_wr_other_conf(struct pcie_port *pp, struct pci_bus *bus, | 52 | int ks_dw_pcie_wr_other_conf(struct pcie_port *pp, struct pci_bus *bus, |