summaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/pci-sh7780.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-03-11 15:46:14 +0900
committerPaul Mundt <lethal@linux-sh.org>2009-04-16 16:00:12 +0900
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 56f673f66cb..4706e880b08 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -45,7 +45,7 @@
* space mapping) will be called via the platform defined function
* pcibios_init_platform().
*/
-static int __init sh7780_pci_init(void)
+int __init sh7780_pci_init(struct pci_channel *chan)
{
unsigned int id;
int ret, match = 0;
@@ -55,7 +55,7 @@ static int __init sh7780_pci_init(void)
ctrl_outl(0x00000001, SH7780_PCI_VCR2); /* Enable PCIC */
/* check for SH7780/SH7780R hardware */
- id = pci_read_reg(NULL, SH7780_PCIVID);
+ id = pci_read_reg(chan, SH7780_PCIVID);
if ((id & 0xffff) == SH7780_VENDOR_ID) {
switch ((id >> 16) & 0xffff) {
case SH7763_DEVICE_ID:
@@ -82,12 +82,11 @@ static int __init sh7780_pci_init(void)
ctrl_outl(0x33333333, INTC_INTPRI);
}
- if ((ret = sh4_pci_check_direct(NULL)) != 0)
+ if ((ret = sh4_pci_check_direct(chan)) != 0)
return ret;
return pcibios_init_platform();
}
-core_initcall(sh7780_pci_init);
int __init sh7780_pcic_init(struct pci_channel *chan,
struct sh4_pci_address_map *map)
@@ -153,5 +152,5 @@ int __init sh7780_pcic_init(struct pci_channel *chan,
word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO;
pci_write_reg(chan, word, SH4_PCICR);
- return 1;
+ return 0;
}