From patchwork Tue Sep 15 08:30:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 47614 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8F8V8eS016354 for ; Tue, 15 Sep 2009 08:31:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751635AbZIOIaa (ORCPT ); Tue, 15 Sep 2009 04:30:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750975AbZIOIaa (ORCPT ); Tue, 15 Sep 2009 04:30:30 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:38990 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbZIOIaZ (ORCPT ); Tue, 15 Sep 2009 04:30:25 -0400 Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id n8F8URdK019729 for (envelope-from kaneshige.kenji@jp.fujitsu.com); Tue, 15 Sep 2009 17:30:27 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 7568B45DE4F for ; Tue, 15 Sep 2009 17:30:27 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 5842E45DE4C for ; Tue, 15 Sep 2009 17:30:27 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 40B4FE18010 for ; Tue, 15 Sep 2009 17:30:27 +0900 (JST) Received: from ml13.s.css.fujitsu.com (ml13.s.css.fujitsu.com [10.249.87.103]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id E2E4AE1800E for ; Tue, 15 Sep 2009 17:30:26 +0900 (JST) Received: from ml13.css.fujitsu.com (ml13 [127.0.0.1]) by ml13.s.css.fujitsu.com (Postfix) with ESMTP id BFC21FD000E; Tue, 15 Sep 2009 17:30:26 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.137]) by ml13.s.css.fujitsu.com (Postfix) with ESMTP id 6AA59FD0001; Tue, 15 Sep 2009 17:30:26 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.100.137] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.137]); Tue, 15 Sep 2009 17:30:18 +0900 (JST) Message-ID: <4AAF5096.4060404@jp.fujitsu.com> Date: Tue, 15 Sep 2009 17:30:14 +0900 From: Kenji Kaneshige User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: linux-pci@vger.kernel.org, jbarnes@virtuousgeek.org CC: ebiederm@xmission.com Subject: [PATCH 11/15] pciehp: remove pci_dev field References: <4AAF4F16.802@jp.fujitsu.com> In-Reply-To: <4AAF4F16.802@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Since we have a pointer to pcie_device in struct controller, we don't need a pointer to pci_dev. Signed-off-by: Kenji Kaneshige --- drivers/pci/hotplug/pciehp.h | 1 - drivers/pci/hotplug/pciehp_core.c | 6 +++--- drivers/pci/hotplug/pciehp_ctrl.c | 6 +++--- drivers/pci/hotplug/pciehp_hpc.c | 15 +++++++-------- drivers/pci/hotplug/pciehp_pci.c | 4 ++-- 5 files changed, 15 insertions(+), 17 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: 20090915/drivers/pci/hotplug/pciehp.h =================================================================== --- 20090915.orig/drivers/pci/hotplug/pciehp.h +++ 20090915/drivers/pci/hotplug/pciehp.h @@ -89,7 +89,6 @@ struct event_info { struct controller { struct mutex ctrl_lock; /* controller lock */ - struct pci_dev *pci_dev; struct pcie_device *pcie; /* PCI Express port service */ struct slot *slot; struct hpc_ops *hpc_ops; Index: 20090915/drivers/pci/hotplug/pciehp_core.c =================================================================== --- 20090915.orig/drivers/pci/hotplug/pciehp_core.c +++ 20090915/drivers/pci/hotplug/pciehp_core.c @@ -124,10 +124,10 @@ static int init_slot(struct controller * snprintf(name, SLOT_NAME_SIZE, "%u", slot->number); ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:00 sun=%x\n", - pci_domain_nr(ctrl->pci_dev->subordinate), - ctrl->pci_dev->subordinate->number, slot->number); + pci_domain_nr(ctrl->pcie->port->subordinate), + ctrl->pcie->port->subordinate->number, slot->number); retval = pci_hp_register(hotplug, - ctrl->pci_dev->subordinate, 0, name); + ctrl->pcie->port->subordinate, 0, name); if (retval) { ctrl_err(ctrl, "pci_hp_register failed with error %d\n", retval); Index: 20090915/drivers/pci/hotplug/pciehp_ctrl.c =================================================================== --- 20090915.orig/drivers/pci/hotplug/pciehp_ctrl.c +++ 20090915/drivers/pci/hotplug/pciehp_ctrl.c @@ -208,7 +208,7 @@ static int board_added(struct slot *p_sl { int retval = 0; struct controller *ctrl = p_slot->ctrl; - struct pci_bus *parent = ctrl->pci_dev->subordinate; + struct pci_bus *parent = ctrl->pcie->port->subordinate; if (POWER_CTRL(ctrl)) { /* Power on slot */ @@ -312,8 +312,8 @@ static void pciehp_power_thread(struct w mutex_unlock(&p_slot->lock); ctrl_dbg(p_slot->ctrl, "Disabling domain:bus:device=%04x:%02x:00\n", - pci_domain_nr(p_slot->ctrl->pci_dev->subordinate), - p_slot->ctrl->pci_dev->subordinate->number); + pci_domain_nr(p_slot->ctrl->pcie->port->subordinate), + p_slot->ctrl->pcie->port->subordinate->number); pciehp_disable_slot(p_slot); mutex_lock(&p_slot->lock); p_slot->state = STATIC_STATE; Index: 20090915/drivers/pci/hotplug/pciehp_hpc.c =================================================================== --- 20090915.orig/drivers/pci/hotplug/pciehp_hpc.c +++ 20090915/drivers/pci/hotplug/pciehp_hpc.c @@ -44,25 +44,25 @@ static atomic_t pciehp_num_controllers = static inline int pciehp_readw(struct controller *ctrl, int reg, u16 *value) { - struct pci_dev *dev = ctrl->pci_dev; + struct pci_dev *dev = ctrl->pcie->port; return pci_read_config_word(dev, ctrl->cap_base + reg, value); } static inline int pciehp_readl(struct controller *ctrl, int reg, u32 *value) { - struct pci_dev *dev = ctrl->pci_dev; + struct pci_dev *dev = ctrl->pcie->port; return pci_read_config_dword(dev, ctrl->cap_base + reg, value); } static inline int pciehp_writew(struct controller *ctrl, int reg, u16 value) { - struct pci_dev *dev = ctrl->pci_dev; + struct pci_dev *dev = ctrl->pcie->port; return pci_write_config_word(dev, ctrl->cap_base + reg, value); } static inline int pciehp_writel(struct controller *ctrl, int reg, u32 value) { - struct pci_dev *dev = ctrl->pci_dev; + struct pci_dev *dev = ctrl->pcie->port; return pci_write_config_dword(dev, ctrl->cap_base + reg, value); } @@ -537,7 +537,7 @@ static int hpc_power_on_slot(struct slot static inline int pcie_mask_bad_dllp(struct controller *ctrl) { - struct pci_dev *dev = ctrl->pci_dev; + struct pci_dev *dev = ctrl->pcie->port; int pos; u32 reg; @@ -554,7 +554,7 @@ static inline int pcie_mask_bad_dllp(str static inline void pcie_unmask_bad_dllp(struct controller *ctrl) { - struct pci_dev *dev = ctrl->pci_dev; + struct pci_dev *dev = ctrl->pcie->port; u32 reg; int pos; @@ -946,7 +946,7 @@ static inline void dbg_ctrl(struct contr { int i; u16 reg16; - struct pci_dev *pdev = ctrl->pci_dev; + struct pci_dev *pdev = ctrl->pcie->port; if (!pciehp_debug) return; @@ -1004,7 +1004,6 @@ struct controller *pcie_init(struct pcie goto abort; } ctrl->pcie = dev; - ctrl->pci_dev = pdev; ctrl->cap_base = pci_find_capability(pdev, PCI_CAP_ID_EXP); if (!ctrl->cap_base) { ctrl_err(ctrl, "Cannot find PCI Express capability\n"); Index: 20090915/drivers/pci/hotplug/pciehp_pci.c =================================================================== --- 20090915.orig/drivers/pci/hotplug/pciehp_pci.c +++ 20090915/drivers/pci/hotplug/pciehp_pci.c @@ -63,7 +63,7 @@ static int __ref pciehp_add_bridge(struc int pciehp_configure_device(struct slot *p_slot) { struct pci_dev *dev; - struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; + struct pci_bus *parent = p_slot->ctrl->pcie->port->subordinate; int num, fn; struct controller *ctrl = p_slot->ctrl; @@ -111,7 +111,7 @@ int pciehp_unconfigure_device(struct slo int j; u8 bctl = 0; u8 presence = 0; - struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; + struct pci_bus *parent = p_slot->ctrl->pcie->port->subordinate; u16 command; struct controller *ctrl = p_slot->ctrl;