diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2013-02-11 02:46:10 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-02-16 12:54:25 -0500 |
commit | 352af7d4dd90bac3640ad2383e4e9f332d3a4537 (patch) | |
tree | f324bc26229909f82df0a7f324f998d5da65a9bf /arch | |
parent | 276fd3c5f8a21f9d7d398383b818d5d0ac81db23 (diff) |
ARM: 7648/1: pci: Allow passing per-controller private data
In order to allow drivers to specify private data for each controller,
this commit adds a private_data field to the struct hw_pci. This field
is an array of nr_controllers pointers that will be used to initialize
the private_data field of the corresponding controller's pci_sys_data
structure.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/mach/pci.h | 1 | ||||
-rw-r--r-- | arch/arm/kernel/bios32.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index db9fedb57f2c..5cf2e979b4be 100644 --- a/arch/arm/include/asm/mach/pci.h +++ b/arch/arm/include/asm/mach/pci.h | |||
@@ -23,6 +23,7 @@ struct hw_pci { | |||
23 | #endif | 23 | #endif |
24 | struct pci_ops *ops; | 24 | struct pci_ops *ops; |
25 | int nr_controllers; | 25 | int nr_controllers; |
26 | void **private_data; | ||
26 | int (*setup)(int nr, struct pci_sys_data *); | 27 | int (*setup)(int nr, struct pci_sys_data *); |
27 | struct pci_bus *(*scan)(int nr, struct pci_sys_data *); | 28 | struct pci_bus *(*scan)(int nr, struct pci_sys_data *); |
28 | void (*preinit)(void); | 29 | void (*preinit)(void); |
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index da7b0c99f296..a1f73b502ef0 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -464,6 +464,9 @@ static void pcibios_init_hw(struct hw_pci *hw, struct list_head *head) | |||
464 | sys->map_irq = hw->map_irq; | 464 | sys->map_irq = hw->map_irq; |
465 | INIT_LIST_HEAD(&sys->resources); | 465 | INIT_LIST_HEAD(&sys->resources); |
466 | 466 | ||
467 | if (hw->private_data) | ||
468 | sys->private_data = hw->private_data[nr]; | ||
469 | |||
467 | ret = hw->setup(nr, sys); | 470 | ret = hw->setup(nr, sys); |
468 | 471 | ||
469 | if (ret > 0) { | 472 | if (ret > 0) { |