diff options
-rw-r--r-- | arch/sh/drivers/pci/ops-sh4.c | 12 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-auto.c | 1 | ||||
-rw-r--r-- | arch/sh/include/asm/pci.h | 6 |
3 files changed, 12 insertions, 7 deletions
diff --git a/arch/sh/drivers/pci/ops-sh4.c b/arch/sh/drivers/pci/ops-sh4.c index 92d27f734f2e..ee62e6de7133 100644 --- a/arch/sh/drivers/pci/ops-sh4.c +++ b/arch/sh/drivers/pci/ops-sh4.c | |||
@@ -26,6 +26,7 @@ static DEFINE_SPINLOCK(sh4_pci_lock); | |||
26 | static int sh4_pci_read(struct pci_bus *bus, unsigned int devfn, | 26 | static int sh4_pci_read(struct pci_bus *bus, unsigned int devfn, |
27 | int where, int size, u32 *val) | 27 | int where, int size, u32 *val) |
28 | { | 28 | { |
29 | struct pci_channel *chan = bus->sysdata; | ||
29 | unsigned long flags; | 30 | unsigned long flags; |
30 | u32 data; | 31 | u32 data; |
31 | 32 | ||
@@ -34,8 +35,8 @@ static int sh4_pci_read(struct pci_bus *bus, unsigned int devfn, | |||
34 | * so we must do byte alignment by hand | 35 | * so we must do byte alignment by hand |
35 | */ | 36 | */ |
36 | spin_lock_irqsave(&sh4_pci_lock, flags); | 37 | spin_lock_irqsave(&sh4_pci_lock, flags); |
37 | pci_write_reg(NULL, CONFIG_CMD(bus, devfn, where), SH4_PCIPAR); | 38 | pci_write_reg(chan, CONFIG_CMD(bus, devfn, where), SH4_PCIPAR); |
38 | data = pci_read_reg(NULL, SH4_PCIPDR); | 39 | data = pci_read_reg(chan, SH4_PCIPDR); |
39 | spin_unlock_irqrestore(&sh4_pci_lock, flags); | 40 | spin_unlock_irqrestore(&sh4_pci_lock, flags); |
40 | 41 | ||
41 | switch (size) { | 42 | switch (size) { |
@@ -63,13 +64,14 @@ static int sh4_pci_read(struct pci_bus *bus, unsigned int devfn, | |||
63 | static int sh4_pci_write(struct pci_bus *bus, unsigned int devfn, | 64 | static int sh4_pci_write(struct pci_bus *bus, unsigned int devfn, |
64 | int where, int size, u32 val) | 65 | int where, int size, u32 val) |
65 | { | 66 | { |
67 | struct pci_channel *chan = bus->sysdata; | ||
66 | unsigned long flags; | 68 | unsigned long flags; |
67 | int shift; | 69 | int shift; |
68 | u32 data; | 70 | u32 data; |
69 | 71 | ||
70 | spin_lock_irqsave(&sh4_pci_lock, flags); | 72 | spin_lock_irqsave(&sh4_pci_lock, flags); |
71 | pci_write_reg(NULL, CONFIG_CMD(bus, devfn, where), SH4_PCIPAR); | 73 | pci_write_reg(chan, CONFIG_CMD(bus, devfn, where), SH4_PCIPAR); |
72 | data = pci_read_reg(NULL, SH4_PCIPDR); | 74 | data = pci_read_reg(chan, SH4_PCIPDR); |
73 | spin_unlock_irqrestore(&sh4_pci_lock, flags); | 75 | spin_unlock_irqrestore(&sh4_pci_lock, flags); |
74 | 76 | ||
75 | switch (size) { | 77 | switch (size) { |
@@ -90,7 +92,7 @@ static int sh4_pci_write(struct pci_bus *bus, unsigned int devfn, | |||
90 | return PCIBIOS_FUNC_NOT_SUPPORTED; | 92 | return PCIBIOS_FUNC_NOT_SUPPORTED; |
91 | } | 93 | } |
92 | 94 | ||
93 | pci_write_reg(NULL, data, SH4_PCIPDR); | 95 | pci_write_reg(chan, data, SH4_PCIPDR); |
94 | 96 | ||
95 | return PCIBIOS_SUCCESSFUL; | 97 | return PCIBIOS_SUCCESSFUL; |
96 | } | 98 | } |
diff --git a/arch/sh/drivers/pci/pci-auto.c b/arch/sh/drivers/pci/pci-auto.c index cf48b12ee58c..1d715ec405b2 100644 --- a/arch/sh/drivers/pci/pci-auto.c +++ b/arch/sh/drivers/pci/pci-auto.c | |||
@@ -67,6 +67,7 @@ static struct pci_dev *fake_pci_dev(struct pci_channel *hose, | |||
67 | dev.devfn = devfn; | 67 | dev.devfn = devfn; |
68 | bus.number = busnr; | 68 | bus.number = busnr; |
69 | bus.ops = hose->pci_ops; | 69 | bus.ops = hose->pci_ops; |
70 | bus.sysdata = hose; | ||
70 | 71 | ||
71 | if(busnr != top_bus) | 72 | if(busnr != top_bus) |
72 | /* Fake a parent bus structure. */ | 73 | /* Fake a parent bus structure. */ |
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h index 5c7a8f1d2d54..386587e08830 100644 --- a/arch/sh/include/asm/pci.h +++ b/arch/sh/include/asm/pci.h | |||
@@ -31,8 +31,10 @@ struct pci_channel { | |||
31 | */ | 31 | */ |
32 | extern struct pci_channel board_pci_channels[]; | 32 | extern struct pci_channel board_pci_channels[]; |
33 | 33 | ||
34 | #define PCIBIOS_MIN_IO board_pci_channels->io_resource->start | 34 | /* ugly as hell, but makes drivers/pci/setup-res.c compile and work */ |
35 | #define PCIBIOS_MIN_MEM board_pci_channels->mem_resource->start | 35 | #define __PCI_CHAN(bus) ((struct pci_channel *)bus->sysdata) |
36 | #define PCIBIOS_MIN_IO __PCI_CHAN(bus)->io_resource->start | ||
37 | #define PCIBIOS_MIN_MEM __PCI_CHAN(bus)->mem_resource->start | ||
36 | 38 | ||
37 | /* | 39 | /* |
38 | * I/O routine helpers | 40 | * I/O routine helpers |