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

powerpc/powernv: Check primary PHB through ID

The index of one specific PCI controller (struct pci_controller::
global_number) can tell that it's primary one or not. So we needn't
additional variable for that and just remove it.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Gavin Shan and committed by
Benjamin Herrenschmidt
2f1ec02e f1b7cc3e

+1 -3
+1 -3
arch/powerpc/platforms/powernv/pci-ioda.c
··· 1104 1104 u64 hub_id, int ioda_type) 1105 1105 { 1106 1106 struct pci_controller *hose; 1107 - static int primary = 1; 1108 1107 struct pnv_phb *phb; 1109 1108 unsigned long size, m32map_off, iomap_off, pemap_off; 1110 1109 const u64 *prop64; ··· 1163 1164 phb->model = PNV_PHB_MODEL_UNKNOWN; 1164 1165 1165 1166 /* Parse 32-bit and IO ranges (if any) */ 1166 - pci_process_bridge_OF_ranges(phb->hose, np, primary); 1167 - primary = 0; 1167 + pci_process_bridge_OF_ranges(hose, np, !hose->global_number); 1168 1168 1169 1169 /* Get registers */ 1170 1170 phb->regs = of_iomap(np, 0);