Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fe519c2 authored by Josh Boyer's avatar Josh Boyer Committed by Paul Mackerras
Browse files

powerpc: Introduce ppc_pci_flags accessors



Currently there are a number of platforms that open code access to
the ppc_pci_flags global variable.  However, that variable is not
present if CONFIG_PCI is not set, which can lead to a build break.

This introduces a number of accessor functions that are defined
to be empty in the case of CONFIG_PCI being disabled.  The
various platform files in the kernel are updated to use these.

Signed-off-by: default avatarJosh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent edc72ac4
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@

struct device_node;

extern unsigned int ppc_pci_flags;
enum {
	/* Force re-assigning all resources (ignore firmware
	 * setup completely)
@@ -36,6 +35,31 @@ enum {
	/* ... except for domain 0 */
	PPC_PCI_COMPAT_DOMAIN_0		= 0x00000020,
};
#ifdef CONFIG_PCI
extern unsigned int ppc_pci_flags;

static inline void ppc_pci_set_flags(int flags)
{
	ppc_pci_flags = flags;
}

static inline void ppc_pci_add_flags(int flags)
{
	ppc_pci_flags |= flags;
}

static inline int ppc_pci_has_flag(int flag)
{
	return (ppc_pci_flags & flag);
}
#else
static inline void ppc_pci_set_flags(int flags) { }
static inline void ppc_pci_add_flags(int flags) { }
static inline int ppc_pci_has_flag(int flag)
{
	return 0;
}
#endif


/*
+2 −2
Original line number Diff line number Diff line
@@ -38,8 +38,8 @@ struct pci_dev;
 * Set this to 1 if you want the kernel to re-assign all PCI
 * bus numbers (don't do that on ppc64 yet !)
 */
#define pcibios_assign_all_busses()    	(ppc_pci_flags & \
					 PPC_PCI_REASSIGN_ALL_BUS)
#define pcibios_assign_all_busses() \
	(ppc_pci_has_flag(PPC_PCI_REASSIGN_ALL_BUS))
#define pcibios_scan_all_fns(a, b)	0

static inline void pcibios_set_master(struct pci_dev *dev)
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ static void __init ep405_setup_arch(void)
	/* Find & init the BCSR CPLD */
	ep405_init_bcsr();

	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
	ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
}

static int __init ep405_probe(void)
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ static int __init kilauea_probe(void)
	if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
		return 0;

	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
	ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);

	return 1;
}
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ static int __init ppc40x_probe(void)

	for (i = 0; i < ARRAY_SIZE(board); i++) {
		if (of_flat_dt_is_compatible(root, board[i])) {
			ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
			ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
			return 1;
		}
	}
Loading