Skip to content

Commit

Permalink
sh/PCI: Remove __init optimisations from IRQ mapping functions/data
Browse files Browse the repository at this point in the history
Currently many IRQ mapping functions and data structures use the __init and
__initdata optimisations. These result in the relevant functions being
innaccessible after boot time.

However for deferred IRQ assignment it is important to have access to these
functions at PCI device enable time.

Therefore, remove the optimisation from the relevant data structures and
functions to prepare for deferred IRQ assignment.

Signed-off-by: Matthew Minter <matt@masarand.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
  • Loading branch information
Matthew Minter authored and Bjorn Helgaas committed Aug 3, 2017
1 parent 902d886 commit 2b8ff9f
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion arch/sh/drivers/pci/fixups-cayman.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <cpu/irq.h>
#include "pci-sh5.h"

int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int result = -1;

Expand Down
2 changes: 1 addition & 1 deletion arch/sh/drivers/pci/fixups-dreamcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void gapspci_fixup_resources(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, gapspci_fixup_resources);

int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
/*
* The interrupt routing semantics here are quite trivial.
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/drivers/pci/fixups-r7780rp.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <linux/sh_intc.h>
#include "pci-sh4.h"

int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{
return evt2irq(0xa20) + slot;
}
6 changes: 3 additions & 3 deletions arch/sh/drivers/pci/fixups-rts7751r2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
#define PCIMCR_MRSET_OFF 0xBFFFFFFF
#define PCIMCR_RFSH_OFF 0xFFFFFFFB

static u8 rts7751r2d_irq_tab[] __initdata = {
static u8 rts7751r2d_irq_tab[] = {
IRQ_PCI_INTA,
IRQ_PCI_INTB,
IRQ_PCI_INTC,
IRQ_PCI_INTD,
};

static char lboxre2_irq_tab[] __initdata = {
static char lboxre2_irq_tab[] = {
IRQ_ETH0, IRQ_ETH1, IRQ_INTA, IRQ_INTD,
};

int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{
if (mach_is_lboxre2())
return lboxre2_irq_tab[slot];
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/drivers/pci/fixups-sdk7780.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define IRQ_INTD evt2irq(0xa80)

/* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */
static char sdk7780_irq_tab[4][16] __initdata = {
static char sdk7780_irq_tab[4][16] = {
/* INTA */
{ IRQ_INTA, IRQ_INTD, IRQ_INTC, IRQ_INTD, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1 },
Expand All @@ -37,7 +37,7 @@ static char sdk7780_irq_tab[4][16] __initdata = {
-1, -1, -1 },
};

int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{
return sdk7780_irq_tab[pin-1][slot];
}
2 changes: 1 addition & 1 deletion arch/sh/drivers/pci/fixups-se7751.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <linux/sh_intc.h>
#include "pci-sh4.h"

int __init pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin)
{
switch (slot) {
case 0: return evt2irq(0x3a0);
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/drivers/pci/fixups-sh03.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <linux/pci.h>
#include <linux/sh_intc.h>

int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int irq;

Expand Down
2 changes: 1 addition & 1 deletion arch/sh/drivers/pci/fixups-snapgear.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <linux/sh_intc.h>
#include "pci-sh4.h"

int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{
int irq = -1;

Expand Down
4 changes: 2 additions & 2 deletions arch/sh/drivers/pci/fixups-titan.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
#include <mach/titan.h>
#include "pci-sh4.h"

static char titan_irq_tab[] __initdata = {
static char titan_irq_tab[] = {
TITAN_IRQ_WAN,
TITAN_IRQ_LAN,
TITAN_IRQ_MPCIA,
TITAN_IRQ_MPCIB,
TITAN_IRQ_USB,
};

int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{
int irq = titan_irq_tab[slot];

Expand Down
2 changes: 1 addition & 1 deletion arch/sh/drivers/pci/pcie-sh7786.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ static int __init pcie_init(struct sh7786_pcie_port *port)
return 0;
}

int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{
return evt2irq(0xae0);
}
Expand Down

0 comments on commit 2b8ff9f

Please sign in to comment.