From patchwork Tue Aug 7 16:10:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 1286981 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E3180DF280 for ; Tue, 7 Aug 2012 16:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755466Ab2HGQS7 (ORCPT ); Tue, 7 Aug 2012 12:18:59 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:40380 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753611Ab2HGQS6 (ORCPT ); Tue, 7 Aug 2012 12:18:58 -0400 Received: by ggnl2 with SMTP id l2so3853120ggn.19 for ; Tue, 07 Aug 2012 09:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=FEoSwtX5gYU04Zp1ub6/U9/4uCli6JTtP/Evt4lKSss=; b=nzjxeicqMRIC74otUsajwbzuQOwbx4w9SGV3njcC5JMdhGI3sB2pgXdPLgWHhaj7M1 qYo1cWB4XsG3HEWGp79smg1PIwMQztPcW4RpbkH5GQp0hYb1rYX1lA6EfTaOPzKgI5os rVjO5MuIJpZhCierbKDCe4ae6MIcZLImntw9r2azJZ3vXkHHvhDCBfdwYPPIXGZ90qhz wLVfOqLCi+xDevAceQpnm7oyDV/qJoWrjneoBmysDgqoPpxyWBLr7tkN3SYJpq3q4LCf nzpUZoFwsuzXUbZAfkTIgpQo1ngCYiImlqIJyFEldZ9kTaEc8/QDm+jI9zK3hiivVLKv DlqQ== Received: by 10.66.90.1 with SMTP id bs1mr20028902pab.13.1344356337187; Tue, 07 Aug 2012 09:18:57 -0700 (PDT) Received: from localhost.localdomain ([58.250.81.2]) by mx.google.com with ESMTPS id pt2sm11429362pbb.58.2012.08.07.09.18.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Aug 2012 09:18:54 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Don Dutile , Yinghai Lu , Greg KH , Kenji Kaneshige Cc: Jiang Liu , Taku Izumi , "Rafael J . Wysocki" , Yijing Wang , Xinwei Hu , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Jiang Liu Subject: [RFC PATCH v1 02/22] PCI: trivial cleanups for drivers/pci/remove.c Date: Wed, 8 Aug 2012 00:10:42 +0800 Message-Id: <1344355862-2726-3-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344355862-2726-1-git-send-email-jiang.liu@huawei.com> References: <1344355862-2726-1-git-send-email-jiang.liu@huawei.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Trivial cleanups for drivers/pci/remove.c: 1) move the comment for pci_stop_and_remove_bus_device() to the right place 2) rename __pci_remove_behind_bridge() to pci_remove_behind_bridge() Signed-off-by: Jiang Liu --- drivers/pci/remove.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index 04a4861..33b6318 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c @@ -78,25 +78,14 @@ void pci_remove_bus(struct pci_bus *pci_bus) } EXPORT_SYMBOL(pci_remove_bus); -static void __pci_remove_behind_bridge(struct pci_dev *dev); -/** - * pci_stop_and_remove_bus_device - remove a PCI device and any children - * @dev: the device to remove - * - * Remove a PCI device from the device lists, informing the drivers - * that the device has been removed. We also remove any subordinate - * buses and children in a depth-first manner. - * - * For each device we remove, delete the device structure from the - * device lists, remove the /proc entry, and notify userspace - * (/sbin/hotplug). - */ +static void pci_remove_behind_bridge(struct pci_dev *dev); + void __pci_remove_bus_device(struct pci_dev *dev) { if (dev->subordinate) { struct pci_bus *b = dev->subordinate; - __pci_remove_behind_bridge(dev); + pci_remove_behind_bridge(dev); pci_remove_bus(b); dev->subordinate = NULL; } @@ -105,13 +94,25 @@ void __pci_remove_bus_device(struct pci_dev *dev) } EXPORT_SYMBOL(__pci_remove_bus_device); +/** + * pci_stop_and_remove_bus_device - remove a PCI device and any children + * @dev: the device to remove + * + * Remove a PCI device from the device lists, informing the drivers + * that the device has been removed. We also remove any subordinate + * buses and children in a depth-first manner. + * + * For each device we remove, delete the device structure from the + * device lists, remove the /proc entry, and notify userspace + * (/sbin/hotplug). + */ void pci_stop_and_remove_bus_device(struct pci_dev *dev) { pci_stop_bus_device(dev); __pci_remove_bus_device(dev); } -static void __pci_remove_behind_bridge(struct pci_dev *dev) +static void pci_remove_behind_bridge(struct pci_dev *dev) { struct list_head *l, *n; @@ -141,7 +142,7 @@ static void pci_stop_behind_bridge(struct pci_dev *dev) void pci_stop_and_remove_behind_bridge(struct pci_dev *dev) { pci_stop_behind_bridge(dev); - __pci_remove_behind_bridge(dev); + pci_remove_behind_bridge(dev); } static void pci_stop_bus_devices(struct pci_bus *bus)