linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] PCI: Stub out read/write/raw/find functions
@ 2018-12-01 20:41 Sinan Kaya
  2018-12-01 20:41 ` [PATCH v1 2/2] PCI/ACPI: alloc ACPI to be built without PCI support Sinan Kaya
  2018-12-17 19:27 ` [PATCH v1 1/2] PCI: Stub out read/write/raw/find functions Bjorn Helgaas
  0 siblings, 2 replies; 8+ messages in thread
From: Sinan Kaya @ 2018-12-01 20:41 UTC (permalink / raw)
  To: linux-pci; +Cc: Sinan Kaya, Bjorn Helgaas

Need stub functions in order to be able to compile ACPI without PCI
support.

Signed-off-by: Sinan Kaya <okaya@kernel.org>
---
 include/linux/pci.h | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 11c71c4ecf75..15407f469d41 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -682,10 +682,22 @@ struct pci_ops {
  * ACPI needs to be able to access PCI config space before we've done a
  * PCI bus scan and created pci_bus structures.
  */
+#ifdef CONFIG_PCI
 int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,
 		 int reg, int len, u32 *val);
 int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
 		  int reg, int len, u32 val);
+#else
+static inline int raw_pci_read(unsigned int domain, unsigned int bus,
+			       unsigned int devfn, int reg, int len, u32 *val)
+{
+	*val = 0;
+	return -EINVAL;
+}
+static inline int raw_pci_write(unsigned int domain, unsigned int bus,
+				unsigned int devfn, int reg, int len, u32 val)
+{ return -EINVAL; }
+#endif
 
 #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
 typedef u64 pci_bus_addr_t;
@@ -1599,7 +1611,27 @@ pci_release_mem_regions(struct pci_dev *pdev)
 }
 
 #else /* CONFIG_PCI is not enabled */
+static inline int pci_bus_read_config_byte(struct pci_bus *bus,
+		unsigned int devfn, int where, u8 *val)
+{ return -EINVAL; }
 
+static inline int pci_bus_read_config_word(struct pci_bus *bus,
+		unsigned int devfn, int where, u16 *val)
+{ return -EINVAL; }
+static inline int pci_bus_read_config_dword(struct pci_bus *bus,
+		unsigned int devfn, int where, u32 *val)
+{ return -EINVAL; }
+static inline int pci_bus_write_config_byte(struct pci_bus *bus,
+		unsigned int devfn, int where, u8 val)
+{ return -EINVAL; }
+static inline int pci_bus_write_config_word(struct pci_bus *bus,
+		unsigned int devfn, int where, u16 val)
+{ return -EINVAL; }
+static inline int pci_bus_write_config_dword(struct pci_bus *bus,
+		unsigned int devfn, int where, u32 val)
+{ return -EINVAL; }
+static inline struct pci_bus *pci_find_bus(int domain, int busnr)
+{ return NULL; }
 static inline void pci_set_flags(int flags) { }
 static inline void pci_add_flags(int flags) { }
 static inline void pci_clear_flags(int flags) { }
-- 
2.19.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-12-18  1:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-01 20:41 [PATCH v1 1/2] PCI: Stub out read/write/raw/find functions Sinan Kaya
2018-12-01 20:41 ` [PATCH v1 2/2] PCI/ACPI: alloc ACPI to be built without PCI support Sinan Kaya
2018-12-02 17:43   ` Sinan Kaya
2018-12-03  8:19   ` Ingo Molnar
2018-12-03 14:02     ` Sinan Kaya
2018-12-17 19:28   ` Bjorn Helgaas
2018-12-17 19:27 ` [PATCH v1 1/2] PCI: Stub out read/write/raw/find functions Bjorn Helgaas
2018-12-18  1:52   ` Sinan Kaya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).