]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
ARM: Introduce pci_common_exit()
authorVidya Sagar <vidyas@nvidia.com>
Mon, 11 Aug 2014 06:23:05 +0000 (11:53 +0530)
committerLaxman Dewangan <ldewangan@nvidia.com>
Wed, 13 Aug 2014 13:55:29 +0000 (06:55 -0700)
commitf9ccec683b1d263427a3ebb1aeca45c0b72dccd5
tree4ac04adf0b87b5508da576895e320d007e2cce85
parent25891faed662df3ebdbaad337181366bd5548cd4
ARM: Introduce pci_common_exit()

In order to support building PCI host drivers as modules, functionality
is required to undo the steps performed by pci_common_init(). The PCI
core provides much of the functionality already, so add a function that
can be called by drivers to wrap the ARM specific bits.
This patch does a number of things to achieve this: it adds a .nr field
to struct pci_sys_data to keep track of the controller number that was
used to initialize it during pci_common_init(). That field is passed to
the new .teardown() callback during cleanup to undo what .setup() did.
Furthermore the list of pci_sys_data structures setup can optionally be
returned via the hw_pci structure's .sys field. If a driver initializes
it, then it is assumed to be an empty list that pci_common_init() will
append to. Otherwise the old behaviour of keeping a local list only is
preserved.
If a driver wants to support unloading, then it needs access to this
list and pass it to pci_common_exit(). This will iterate over the list,
call the new .teardown() callback and remove the root bus associated
with each entry.

vidyas: make similar change for ARM64
based on http://git-master/r/#/c/449135/

Bug 1496843

Change-Id: I1091c287a0e2da82e423abe6870c3a5eb63fa695
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-on: http://git-master/r/454900
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
arch/arm64/include/asm/mach/pci.h
arch/arm64/kernel/bios32.c