From patchwork Sat Dec 1 20:41:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 1006423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Qxo7u8RC"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 436jq21Q4Kz9s8J for ; Sun, 2 Dec 2018 07:41:49 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725746AbeLBHzK (ORCPT ); Sun, 2 Dec 2018 02:55:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:52840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725726AbeLBHzK (ORCPT ); Sun, 2 Dec 2018 02:55:10 -0500 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [40.87.65.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 397B221473; Sat, 1 Dec 2018 20:41:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543696907; bh=Lxa+tqGCpYkV+x0N9nXY11IdiWx9UetACQJABYQl8QA=; h=From:To:Cc:Subject:Date:From; b=Qxo7u8RCKFft8BpOSYtLk3H7DJdS73aOy5xPj03GVwAkrAkYDCa2XrZB4xfdJzZNf d/U0n+87Fg9U85Bdzu9Z5eEbAlyVRymScT86WC4u1tejLnf0Rvr/DbkjjPerhshOHe IcC07ZljC5osOJ/Qh1rQ3wRwgmb7AK9H+hU7io3A= From: Sinan Kaya To: linux-pci@vger.kernel.org Cc: Sinan Kaya , Bjorn Helgaas Subject: [PATCH v1 1/2] PCI: Stub out read/write/raw/find functions Date: Sat, 1 Dec 2018 20:41:35 +0000 Message-Id: <20181201204137.1786-1-okaya@kernel.org> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Need stub functions in order to be able to compile ACPI without PCI support. Signed-off-by: Sinan Kaya --- 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) { }