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>
This commit is contained in:
Magnus Damm
2009-03-11 15:46:14 +09:00
committed by Paul Mundt
parent b8b47bfbe4
commit d0e3db40e2
20 changed files with 56 additions and 42 deletions

View File

@ -42,15 +42,6 @@ static struct resource gapspci_mem_resource = {
.flags = IORESOURCE_MEM,
};
static struct pci_ops gapspci_pci_ops;
struct pci_channel board_pci_channels[] = {
{ &gapspci_pci_ops, &gapspci_io_resource,
&gapspci_mem_resource, 0, 1 },
{ 0, }
};
EXPORT_SYMBOL(board_pci_channels);
/*
* The !gapspci_config_access case really shouldn't happen, ever, unless
* someone implicitly messes around with the last devfn value.. otherwise we
@ -116,7 +107,7 @@ static struct pci_ops gapspci_pci_ops = {
* gapspci init
*/
int __init gapspci_init(void)
static int __init gapspci_init(struct pci_channel *chan)
{
char idbuf[16];
int i;
@ -168,3 +159,10 @@ char * __devinit pcibios_setup(char *str)
{
return str;
}
struct pci_channel board_pci_channels[] = {
{ gapspci_init, &gapspci_pci_ops, &gapspci_io_resource,
&gapspci_mem_resource, 0, 1 },
{ 0, }
};
EXPORT_SYMBOL(board_pci_channels);