aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/pci-sh7780.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-03-11 02:46:14 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-04-16 03:00:12 -0400
commitd0e3db40e2a1352aa2a2f425a7d4631bddc03d51 (patch)
tree275392db569a7f3808d8f86cfcb4874bfe81f997 /arch/sh/drivers/pci/pci-sh7780.c
parentb8b47bfbe4eb1ae0e6891e49c86a5f4fb00413be (diff)
sh: add init member to pci_channel data
This patch adds an init callback to struct pci_channel and makes sure it is initialized properly. Code is added to call this init function from pcibios_init(). Return values are adjusted and a warning is is printed if init fails. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/pci/pci-sh7780.c')
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index 56f673f66cb5..4706e880b087 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -45,7 +45,7 @@
45 * space mapping) will be called via the platform defined function 45 * space mapping) will be called via the platform defined function
46 * pcibios_init_platform(). 46 * pcibios_init_platform().
47 */ 47 */
48static int __init sh7780_pci_init(void) 48int __init sh7780_pci_init(struct pci_channel *chan)
49{ 49{
50 unsigned int id; 50 unsigned int id;
51 int ret, match = 0; 51 int ret, match = 0;
@@ -55,7 +55,7 @@ static int __init sh7780_pci_init(void)
55 ctrl_outl(0x00000001, SH7780_PCI_VCR2); /* Enable PCIC */ 55 ctrl_outl(0x00000001, SH7780_PCI_VCR2); /* Enable PCIC */
56 56
57 /* check for SH7780/SH7780R hardware */ 57 /* check for SH7780/SH7780R hardware */
58 id = pci_read_reg(NULL, SH7780_PCIVID); 58 id = pci_read_reg(chan, SH7780_PCIVID);
59 if ((id & 0xffff) == SH7780_VENDOR_ID) { 59 if ((id & 0xffff) == SH7780_VENDOR_ID) {
60 switch ((id >> 16) & 0xffff) { 60 switch ((id >> 16) & 0xffff) {
61 case SH7763_DEVICE_ID: 61 case SH7763_DEVICE_ID:
@@ -82,12 +82,11 @@ static int __init sh7780_pci_init(void)
82 ctrl_outl(0x33333333, INTC_INTPRI); 82 ctrl_outl(0x33333333, INTC_INTPRI);
83 } 83 }
84 84
85 if ((ret = sh4_pci_check_direct(NULL)) != 0) 85 if ((ret = sh4_pci_check_direct(chan)) != 0)
86 return ret; 86 return ret;
87 87
88 return pcibios_init_platform(); 88 return pcibios_init_platform();
89} 89}
90core_initcall(sh7780_pci_init);
91 90
92int __init sh7780_pcic_init(struct pci_channel *chan, 91int __init sh7780_pcic_init(struct pci_channel *chan,
93 struct sh4_pci_address_map *map) 92 struct sh4_pci_address_map *map)
@@ -153,5 +152,5 @@ int __init sh7780_pcic_init(struct pci_channel *chan,
153 word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO; 152 word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO;
154 pci_write_reg(chan, word, SH4_PCICR); 153 pci_write_reg(chan, word, SH4_PCICR);
155 154
156 return 1; 155 return 0;
157} 156}