diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-03-11 02:46:14 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-16 03:00:12 -0400 |
commit | d0e3db40e2a1352aa2a2f425a7d4631bddc03d51 (patch) | |
tree | 275392db569a7f3808d8f86cfcb4874bfe81f997 /arch/sh/drivers/pci/pci-sh7751.c | |
parent | b8b47bfbe4eb1ae0e6891e49c86a5f4fb00413be (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-sh7751.c')
-rw-r--r-- | arch/sh/drivers/pci/pci-sh7751.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c index 9c2c01490d6..230db8bd974 100644 --- a/arch/sh/drivers/pci/pci-sh7751.c +++ b/arch/sh/drivers/pci/pci-sh7751.c | |||
@@ -32,7 +32,7 @@ | |||
32 | * space mapping) will be called via the platform defined function | 32 | * space mapping) will be called via the platform defined function |
33 | * pcibios_init_platform(). | 33 | * pcibios_init_platform(). |
34 | */ | 34 | */ |
35 | static int __init sh7751_pci_init(void) | 35 | int __init sh7751_pci_init(struct pci_channel *chan) |
36 | { | 36 | { |
37 | unsigned int id; | 37 | unsigned int id; |
38 | int ret; | 38 | int ret; |
@@ -40,19 +40,18 @@ static int __init sh7751_pci_init(void) | |||
40 | pr_debug("PCI: Starting intialization.\n"); | 40 | pr_debug("PCI: Starting intialization.\n"); |
41 | 41 | ||
42 | /* check for SH7751/SH7751R hardware */ | 42 | /* check for SH7751/SH7751R hardware */ |
43 | id = pci_read_reg(NULL, SH7751_PCICONF0); | 43 | id = pci_read_reg(chan, SH7751_PCICONF0); |
44 | if (id != ((SH7751_DEVICE_ID << 16) | SH7751_VENDOR_ID) && | 44 | if (id != ((SH7751_DEVICE_ID << 16) | SH7751_VENDOR_ID) && |
45 | id != ((SH7751R_DEVICE_ID << 16) | SH7751_VENDOR_ID)) { | 45 | id != ((SH7751R_DEVICE_ID << 16) | SH7751_VENDOR_ID)) { |
46 | pr_debug("PCI: This is not an SH7751(R) (%x)\n", id); | 46 | pr_debug("PCI: This is not an SH7751(R) (%x)\n", id); |
47 | return -ENODEV; | 47 | return -ENODEV; |
48 | } | 48 | } |
49 | 49 | ||
50 | if ((ret = sh4_pci_check_direct(NULL)) != 0) | 50 | if ((ret = sh4_pci_check_direct(chan)) != 0) |
51 | return ret; | 51 | return ret; |
52 | 52 | ||
53 | return pcibios_init_platform(); | 53 | return pcibios_init_platform(); |
54 | } | 54 | } |
55 | subsys_initcall(sh7751_pci_init); | ||
56 | 55 | ||
57 | static int __init __area_sdram_check(struct pci_channel *chan, | 56 | static int __init __area_sdram_check(struct pci_channel *chan, |
58 | unsigned int area) | 57 | unsigned int area) |
@@ -178,7 +177,7 @@ int __init sh7751_pcic_init(struct pci_channel *chan, | |||
178 | } | 177 | } |
179 | 178 | ||
180 | if (!word) | 179 | if (!word) |
181 | return 0; | 180 | return -1; |
182 | 181 | ||
183 | /* configure the wait control registers */ | 182 | /* configure the wait control registers */ |
184 | word = ctrl_inl(SH7751_WCR1); | 183 | word = ctrl_inl(SH7751_WCR1); |
@@ -202,5 +201,5 @@ int __init sh7751_pcic_init(struct pci_channel *chan, | |||
202 | word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_ARBM; | 201 | word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_ARBM; |
203 | pci_write_reg(chan, word, SH4_PCICR); | 202 | pci_write_reg(chan, word, SH4_PCICR); |
204 | 203 | ||
205 | return 1; | 204 | return 0; |
206 | } | 205 | } |