From patchwork Fri Apr 12 15:44:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2437021 Return-Path: X-Original-To: patchwork-linux-acpi@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 2B4C2DF2A1 for ; Fri, 12 Apr 2013 15:50:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753881Ab3DLPqV (ORCPT ); Fri, 12 Apr 2013 11:46:21 -0400 Received: from mail-da0-f53.google.com ([209.85.210.53]:50837 "EHLO mail-da0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754611Ab3DLPqT (ORCPT ); Fri, 12 Apr 2013 11:46:19 -0400 Received: by mail-da0-f53.google.com with SMTP id n34so1183247dal.26 for ; Fri, 12 Apr 2013 08:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=hesukucLxEPCEOUkl8CfB004Ya3VRUGtnkJTjOyhTM8=; b=C+zJGFbmGO9N+OosrE4oMLxYRtQRZfvPBWsW6iTC3GbDuBZM46ONSZ6ltArnOzv4Fa 8sdVgqVHExcB7pv1MXpvg3QObymmgRmScWJc9at8Znpl9I6utXab+wA5BmDr0TVw4yRU 9FHQw+sPx+lL3LmCCvi5Obhm44pXwA8yIvmTSrSLJPE2k5bunqE1JZYtja7+jr29804c OYzP9NjP1iT0pTU1jz0uEATWhHXhS5Z8aJdXTyOEVDBsDqmJiuhugQ7kED5V3+7fm1Lx bT+MEgWTHv2JFBquFnwBV1gvTdf+GCg3mENaJ2SaVo3cM2AJJmGa2SVqOjDMS13CfXWp Ic0A== X-Received: by 10.68.209.162 with SMTP id mn2mr15249698pbc.190.1365781579298; Fri, 12 Apr 2013 08:46:19 -0700 (PDT) Received: from localhost.localdomain ([114.250.74.212]) by mx.google.com with ESMTPS id wz9sm9048741pbc.5.2013.04.12.08.46.12 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 08:46:18 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , "Rafael J . Wysocki" Cc: Jiang Liu , Yinghai Lu , Yijing Wang , Jiang Liu , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Greg Kroah-Hartman , ACPI Devel Maling List , Toshi Kani , Myron Stowe Subject: [PATCH v9 02/16] pci: clean up usages of pci_bus->is_added Date: Fri, 12 Apr 2013 23:44:16 +0800 Message-Id: <1365781470-32379-3-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1365781470-32379-1-git-send-email-jiang.liu@huawei.com> References: <1365781470-32379-1-git-send-email-jiang.liu@huawei.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Now pci_bus->is_added is only used to guard invoking of pcibios_fixup_bus(), so clean up the code. Signed-off-by: Jiang Liu --- drivers/pci/bus.c | 11 ++--------- drivers/pci/probe.c | 3 +-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 8647dc6..bdc1e8b 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -206,16 +206,9 @@ void pci_bus_add_devices(const struct pci_bus *bus) list_for_each_entry(dev, &bus->devices, bus_list) { BUG_ON(!dev->is_added); - child = dev->subordinate; - - if (!child) - continue; - pci_bus_add_devices(child); - - if (child->is_added) - continue; - child->is_added = 1; + if (child) + pci_bus_add_devices(child); } } diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index b494066..45c93b3 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1627,8 +1627,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus) if (!bus->is_added) { dev_dbg(&bus->dev, "fixups for bus\n"); pcibios_fixup_bus(bus); - if (pci_is_root_bus(bus)) - bus->is_added = 1; + bus->is_added = 1; } for (pass=0; pass < 2; pass++)