From patchwork Wed Sep 19 18:54:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 1479661 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5DDE7400EC for ; Wed, 19 Sep 2012 19:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933010Ab2ISTAg (ORCPT ); Wed, 19 Sep 2012 15:00:36 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:48037 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756991Ab2ISSza (ORCPT ); Wed, 19 Sep 2012 14:55:30 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q8JItL98029822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Sep 2012 18:55:22 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q8JItLEU009402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Sep 2012 18:55:21 GMT Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q8JItK4r016498; Wed, 19 Sep 2012 13:55:20 -0500 Received: from linux-siqj.site (/10.132.126.191) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 19 Sep 2012 11:55:20 -0700 From: Yinghai Lu To: Bjorn Helgaas , Len Brown , Taku Izumi , Jiang Liu , x86 Cc: Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Yinghai Lu Subject: [PATCH 27/40] ACPI: acpi_bus_trim to support two steps. Date: Wed, 19 Sep 2012 11:54:41 -0700 Message-Id: <1348080894-23412-28-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1348080894-23412-1-git-send-email-yinghai@kernel.org> References: <1348080894-23412-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org current all acpi_bus_trim callers have rmdevice to 1. that means it will remove all acpi devices. When 0, is passed, it will keep one parent. For root bus hotremove support, we need to have pci device removed before acpi devices. So try to keep all acpi devices, and only stop drivers with them. This change should be safe because all current callers all have 1 passed. Signed-off-by: Yinghai Lu Cc: Len Brown Cc: linux-acpi@vger.kernel.org --- drivers/acpi/scan.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index d1ecca2..d1a1f25 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1539,10 +1539,7 @@ int acpi_bus_trim(struct acpi_device *start, int rmdevice) child = parent; parent = parent->parent; - if (level == 0) - err = acpi_bus_remove(child, rmdevice); - else - err = acpi_bus_remove(child, 1); + err = acpi_bus_remove(child, rmdevice); continue; }