From patchwork Wed Mar 25 05:35:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 454207 X-Patchwork-Delegate: michael@ellerman.id.au Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 327B414011D for ; Wed, 25 Mar 2015 17:18:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=axtens.net header.i=@axtens.net header.b=Hzy5S1wu; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 094C81A3005 for ; Wed, 25 Mar 2015 17:18:30 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=axtens.net header.i=@axtens.net header.b=Hzy5S1wu; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pd0-x22c.google.com (mail-pd0-x22c.google.com [IPv6:2607:f8b0:400e:c02::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 200501A09DD for ; Wed, 25 Mar 2015 16:37:24 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=axtens.net header.i=@axtens.net header.b=Hzy5S1wu; dkim-adsp=pass; dkim-atps=neutral Received: by pdnc3 with SMTP id c3so17207446pdn.0 for ; Tue, 24 Mar 2015 22:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EUkgg2NQc5TrhzQoDoaqXNAwhKOF4pepi5pXTDwxGVg=; b=Hzy5S1wuX8kwgHtJnlPP2JunuI/s+oHJnlbdZ+haZ4jYHVJUKWuD7YDpRkt9NG6uxh 1BnUnALbiu0CH4lEoHQx6pSxioVghs7J369gC4u4IdCJLGEjmx22cMp3GgC42m+WSAGs QQ7ubSPKXK61L91O01j8YvhXTPw7ynnj1IWMI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EUkgg2NQc5TrhzQoDoaqXNAwhKOF4pepi5pXTDwxGVg=; b=aeqioDs/7I4pR9+i4wBRaBFbG4GTmGdQMjAUDmNh7mYwaS7UmxQqLgkx6t9HeX18Zu OqQTEUBcgqsLq9CbsDU/KEnmUxsyCL1uyhi+qod5V7Xiq4kSOzBqKZrb+IAliGFfanyf x2vySODo5E9dewNUpi6MV1+JQ42MOjBUgtjvy2Bwtr8QaK4TNbnh5FJbcvCph1omGq20 DWCGomQhogJIt3zWfWEnHpmXTowsZ4gr4ejVV1whWWPBvOE7ZJcKsVhbOdnZR78Uk7PI kARiSwllCkINkF6ZCaCWzCsZJK56gPu092rDZqlYHF+EMsbwdt3QJ6ZvL97rTZceqPNe UJpg== X-Gm-Message-State: ALoCoQngkcFPIIkC6BuGuHvGKWpKWNlwpD1welRktdawq+JJxGZwEsl2Cd75Qg9ZTtxQbjGDF6rX X-Received: by 10.70.88.172 with SMTP id bh12mr13903866pdb.52.1427261842446; Tue, 24 Mar 2015 22:37:22 -0700 (PDT) Received: from omicron.ozlabs.ibm.com ([122.99.82.10]) by mx.google.com with ESMTPSA id ve3sm1054803pbc.22.2015.03.24.22.37.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Mar 2015 22:37:21 -0700 (PDT) From: Daniel Axtens To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 24/27] powerpc: Remove shim for pci_controller_ops.probe_mode Date: Wed, 25 Mar 2015 16:35:58 +1100 Message-Id: <1427261761-22952-25-git-send-email-dja@axtens.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427261761-22952-1-git-send-email-dja@axtens.net> References: <1427261761-22952-1-git-send-email-dja@axtens.net> Cc: Daniel Axtens X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This also moves back the defines, as explained in the commit that created the shim. Signed-off-by: Daniel Axtens --- arch/powerpc/include/asm/machdep.h | 1 - arch/powerpc/include/asm/pci-bridge.h | 16 ---------------- arch/powerpc/include/asm/pci.h | 5 +++++ arch/powerpc/kernel/pci-common.c | 4 ++-- arch/powerpc/kernel/pci-hotplug.c | 6 +++++- arch/powerpc/kernel/pci_of_scan.c | 6 +++++- 6 files changed, 17 insertions(+), 21 deletions(-) diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 5549b6c..dfc8d2b 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h @@ -127,7 +127,6 @@ struct machdep_calls { /* PCI stuff */ /* Called after scanning the bus, before allocating resources */ void (*pcibios_fixup)(void); - int (*pci_probe_mode)(struct pci_bus *); void (*pci_irq_fixup)(struct pci_dev *dev); int (*pcibios_root_bridge_prepare)(struct pci_host_bridge *bridge); diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 029def0..b5d8631 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -12,11 +12,6 @@ #include #include -/* Return values for pci_controller_ops.probe_mode function */ -#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ -#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ -#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ - struct device_node; /* @@ -305,16 +300,5 @@ static inline void dma_bus_setup(struct pci_bus *bus) ppc_md.pci_dma_bus_setup(bus); } -static inline int probe_mode(struct pci_bus *bus) -{ - struct pci_controller *hose = pci_bus_to_host(bus); - - if (hose->controller_ops.probe_mode) - return hose->controller_ops.probe_mode(bus); - if (ppc_md.pci_probe_mode) - return ppc_md.pci_probe_mode(bus); - return PCI_PROBE_NORMAL; -} - #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_PCI_BRIDGE_H */ diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h index 8745067..4aef8d6 100644 --- a/arch/powerpc/include/asm/pci.h +++ b/arch/powerpc/include/asm/pci.h @@ -22,6 +22,11 @@ #include +/* Return values for pci_controller_ops.probe_mode function */ +#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ +#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ +#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ + #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 5b90e99c..a61ecb4 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -1628,8 +1628,8 @@ void pcibios_scan_phb(struct pci_controller *hose) /* Get probe mode and perform scan */ mode = PCI_PROBE_NORMAL; - if (node) - mode = probe_mode(bus); + if (node && hose->controller_ops.probe_mode) + mode = hose->controller_ops.probe_mode(bus); pr_debug(" probe mode: %d\n", mode); if (mode == PCI_PROBE_DEVTREE) of_scan_bus(node, bus); diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c index 504d823..e9b0a4a 100644 --- a/arch/powerpc/kernel/pci-hotplug.c +++ b/arch/powerpc/kernel/pci-hotplug.c @@ -73,12 +73,16 @@ void pcibios_add_pci_devices(struct pci_bus * bus) { int slotno, mode, pass, max; struct pci_dev *dev; + struct pci_controller *hose; struct device_node *dn = pci_bus_to_OF_node(bus); eeh_add_device_tree_early(dn); + hose = pci_bus_to_host(bus); + mode = PCI_PROBE_NORMAL; - mode = probe_mode(bus); + if (hose->controller_ops.probe_mode) + mode = hose->controller_ops.probe_mode(bus); if (mode == PCI_PROBE_DEVTREE) { /* use ofdt-based probe */ diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c index ae1767b..8312962 100644 --- a/arch/powerpc/kernel/pci_of_scan.c +++ b/arch/powerpc/kernel/pci_of_scan.c @@ -207,6 +207,7 @@ void of_scan_pci_bridge(struct pci_dev *dev) { struct device_node *node = dev->dev.of_node; struct pci_bus *bus; + struct pci_controller *hose; const __be32 *busrange, *ranges; int len, i, mode; struct pci_bus_region region; @@ -286,8 +287,11 @@ void of_scan_pci_bridge(struct pci_dev *dev) bus->number); pr_debug(" bus name: %s\n", bus->name); + hose = pci_bus_to_host(bus); + mode = PCI_PROBE_NORMAL; - mode = probe_mode(bus); + if (hose->controller_ops.probe_mode) + mode = hose->controller_ops.probe_mode(bus); pr_debug(" probe mode: %d\n", mode); if (mode == PCI_PROBE_DEVTREE)