Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0e3db40 authored by Magnus Damm's avatar Magnus Damm Committed by Paul Mundt
Browse files

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: default avatarMagnus Damm <damm@igel.co.jp>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent b8b47bfb
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@

extern struct irq_chip systemasic_int;
extern void aica_time_init(void);
extern int gapspci_init(void);
extern int systemasic_irq_demux(int);

static void __init dreamcast_setup(char **cmdline_p)
@@ -51,11 +50,6 @@ static void __init dreamcast_setup(char **cmdline_p)
					 handle_level_irq);

	board_time_init = aica_time_init;

#ifdef CONFIG_PCI
	if (gapspci_init() < 0)
		printk(KERN_WARNING "GAPSPCI was not detected.\n");
#endif
}

static struct sh_machine_vector mv_dreamcast __initmv = {
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
}

struct pci_channel board_pci_channels[] = {
	{ &sh5_pci_ops, NULL, NULL, 0, 0xff },
	{ sh5_pci_init, &sh5_pci_ops, NULL, NULL, 0, 0xff },
	{ NULL, NULL, NULL, 0, 0 },
};
EXPORT_SYMBOL(board_pci_channels);
+8 −10
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ static struct resource sh7751_mem_resource = {
};

struct pci_channel board_pci_channels[] = {
	{&sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0x3ff},
	{ sh7751_pci_init, &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0x3ff},
	{NULL, NULL, NULL, 0, 0},
};

+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ static struct resource sh7751_mem_resource = {
extern struct pci_ops sh7751_pci_ops;

struct pci_channel board_pci_channels[] = {
	{ &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
	{ sh7751_pci_init, &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
	{ NULL, NULL, NULL, 0, 0 },
};

Loading