All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sinan Kaya <okaya@kernel.org>
To: linux-pci@vger.kernel.org
Cc: Sinan Kaya <okaya@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>
Subject: [PATCH v1 1/2] PCI: Stub out read/write/raw/find functions
Date: Sat,  1 Dec 2018 20:41:35 +0000	[thread overview]
Message-ID: <20181201204137.1786-1-okaya@kernel.org> (raw)

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


             reply	other threads:[~2018-12-01 20:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-01 20:41 Sinan Kaya [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181201204137.1786-1-okaya@kernel.org \
    --to=okaya@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.