Commit 5f926354 authored by Keith Busch's avatar Keith Busch Committed by Ralf Baechle

MIPS: PCI: Reduce stack frame usage

This patch removes creating a fake pci device in MIPS early config
access and instead just uses the pci bus to get the same functionality.
The struct pci_dev is too large to allocate on the stack, and was relying
on compiler optimizations to remove its usage.
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Reviewed-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14253/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 44ce9a9a
...@@ -29,12 +29,8 @@ static int __init ...@@ -29,12 +29,8 @@ static int __init
early_read_config_word(struct pci_controller *hose, early_read_config_word(struct pci_controller *hose,
int top_bus, int bus, int devfn, int offset, u16 *value) int top_bus, int bus, int devfn, int offset, u16 *value)
{ {
struct pci_dev fake_dev;
struct pci_bus fake_bus; struct pci_bus fake_bus;
fake_dev.bus = &fake_bus;
fake_dev.sysdata = hose;
fake_dev.devfn = devfn;
fake_bus.number = bus; fake_bus.number = bus;
fake_bus.sysdata = hose; fake_bus.sysdata = hose;
fake_bus.ops = hose->pci_ops; fake_bus.ops = hose->pci_ops;
...@@ -45,7 +41,7 @@ early_read_config_word(struct pci_controller *hose, ...@@ -45,7 +41,7 @@ early_read_config_word(struct pci_controller *hose,
else else
fake_bus.parent = NULL; fake_bus.parent = NULL;
return pci_read_config_word(&fake_dev, offset, value); return pci_bus_read_config_word(&fake_bus, devfn, offset, value);
} }
int __init txx9_pci66_check(struct pci_controller *hose, int top_bus, int __init txx9_pci66_check(struct pci_controller *hose, int top_bus,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment