Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/pci: Clean up direct access to sysdata by indirect ops

We shouldn't directly access sysdata to get the pci_controller. Instead
use pci_bus_to_host() for this purpose. In the future we might have
sysdata be a device_node to match ppc64 and unify the code between ppc32
& ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Kumar Gala and committed by
Benjamin Herrenschmidt
19afa407 60dbf438

+2 -2
+2 -2
arch/powerpc/sysdev/indirect_pci.c
··· 24 24 indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 25 25 int len, u32 *val) 26 26 { 27 - struct pci_controller *hose = bus->sysdata; 27 + struct pci_controller *hose = pci_bus_to_host(bus); 28 28 volatile void __iomem *cfg_data; 29 29 u8 cfg_type = 0; 30 30 u32 bus_no, reg; ··· 82 82 indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 83 83 int len, u32 val) 84 84 { 85 - struct pci_controller *hose = bus->sysdata; 85 + struct pci_controller *hose = pci_bus_to_host(bus); 86 86 volatile void __iomem *cfg_data; 87 87 u8 cfg_type = 0; 88 88 u32 bus_no, reg;