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: Josh Boyer <jwboyer@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:

committed by
Paul Mackerras

parent
edc72ac4a0
commit
7fe519c207
@@ -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
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user