From patchwork Mon Nov 6 03:24:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 834438 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 ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yVdJT3N99z9s7p for ; Mon, 6 Nov 2017 14:26:33 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yVdJT2CX3zDrLK for ; Mon, 6 Nov 2017 14:26:33 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=ozlabs.ru (client-ip=107.173.13.209; helo=ozlabs.ru; envelope-from=aik@ozlabs.ru; receiver=) Received: from ozlabs.ru (ozlabs.ru [107.173.13.209]) by lists.ozlabs.org (Postfix) with ESMTP id 3yVdH24cz1zDr8P for ; Mon, 6 Nov 2017 14:25:18 +1100 (AEDT) Received: from vpl1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id A3D1A3A6000D; Sun, 5 Nov 2017 22:23:44 -0500 (EST) From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH kernel] powerpc/pci: Get rid of unused @parent pointer in pci_controller Date: Mon, 6 Nov 2017 14:24:41 +1100 Message-Id: <20171106032441.10031-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.11.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Neuling , Alexey Kardashevskiy , Frederic Barrat , Paul Mackerras , Andrew Donnellan Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The @parent pointer is supposed to point to a device which represents a PCI controller, however it is never set to anything and remains NULL; it is also quite common to pass NULL to pci_create_root_bus(). Signed-off-by: Alexey Kardashevskiy --- This @parent is NULL for every PHB in garrison machines, for example. Where would this pointer be really used? I wonder how does setting it make any difference in sysfs for CXL vphb? In general, I'd think that @parent makes sense and every PHB has a parent device struct like any other device and the platform code binds a correct device driver to a PHB and we can avoid having PNV_PHB_IODA2&co switches but for some reason PHBs are hardcoded in the platform code. --- arch/powerpc/include/asm/pci-bridge.h | 1 - arch/powerpc/kernel/pci-common.c | 2 +- drivers/misc/cxl/vphb.c | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 752718a2949d..ad88ddeaa6b7 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -60,7 +60,6 @@ struct pci_controller { #endif struct device_node *dn; struct list_head list_node; - struct device *parent; int first_busno; int last_busno; diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 02831a396419..597576777c34 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -1681,7 +1681,7 @@ void pcibios_scan_phb(struct pci_controller *hose) pci_add_resource(&resources, &hose->busn); /* Create an empty bus for the toplevel */ - bus = pci_create_root_bus(hose->parent, hose->first_busno, + bus = pci_create_root_bus(NULL, hose->first_busno, hose->ops, hose, &resources); if (bus == NULL) { pr_err("Failed to create bus for PCI domain %04x\n", diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c index 512a4897dbf6..ae3fe1563812 100644 --- a/drivers/misc/cxl/vphb.c +++ b/drivers/misc/cxl/vphb.c @@ -232,9 +232,6 @@ int cxl_pci_vphb_add(struct cxl_afu *afu) if (!phb) return -ENODEV; - /* Setup parent in sysfs */ - phb->parent = parent; - /* Setup the PHB using arch provided callback */ phb->ops = &cxl_pcie_pci_ops; phb->cfg_addr = NULL;