From patchwork Tue May 14 16:51:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2567851 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 BF061E00E6 for ; Tue, 14 May 2013 16:54:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757635Ab3ENQx2 (ORCPT ); Tue, 14 May 2013 12:53:28 -0400 Received: from mail-pb0-f53.google.com ([209.85.160.53]:39819 "EHLO mail-pb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758170Ab3ENQxZ (ORCPT ); Tue, 14 May 2013 12:53:25 -0400 Received: by mail-pb0-f53.google.com with SMTP id un1so583961pbc.40 for ; Tue, 14 May 2013 09:53:25 -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=XRhLtzb4LdnPvbDDXNvvQp1pnrN80f3sbcFFf8kQ6Dg=; b=nyfXvdQkI3OhTVvePAdIpYAN08tY2YzyfYe+SsMWcfFrPk9s8ULFyJck1GMdAsLcIL 2FlwBq6i41EYJOW9P4TdQEHF2bt3Wx6m5gSEfvYvzEfdsygD+BvUL/w7CRED+WRpP4wS 8jskomN+gy+GCnmbHSWPiRVbmFnikt6nTKOiAJEulkknmZTfmU8EZRhQ5Wimp4HmAdfg TZVcoOIqZurzFvUlDNcUuxCNyMI7vvDRsIn48joKxR8jTi2g/lYNhazzdGHfuLNvJtDA yijDAAPXl5EK7zoAdDiuYV2IRH7OP2ncQ43sGnzpdE0BppbiOjBDwhi5YHsgdYwXnL4k UIrg== X-Received: by 10.66.149.227 with SMTP id ud3mr36100860pab.33.1368550404924; Tue, 14 May 2013 09:53:24 -0700 (PDT) Received: from localhost.localdomain ([120.196.98.100]) by mx.google.com with ESMTPSA id v5sm18919924pbz.4.2013.05.14.09.53.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 May 2013 09:53:23 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Yinghai Lu Cc: Jiang Liu , "Rafael J . Wysocki" , Greg Kroah-Hartman , Gu Zheng , Toshi Kani , Myron Stowe , Yijing Wang , Jiang Liu , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown , linux-acpi@vger.kernel.org Subject: [RFC PATCH v2, part 2 12/18] PCI, ACPI: use hotplug-safe iterators to walk PCI buses Date: Wed, 15 May 2013 00:51:56 +0800 Message-Id: <1368550322-1045-12-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1368550322-1045-1-git-send-email-jiang.liu@huawei.com> References: <1368550322-1045-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 Enhance ACPI reset drvier to use hotplug-safe iterators to walk PCI buses. Signed-off-by: Jiang Liu Cc: Len Brown Cc: "Rafael J. Wysocki" Cc: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Rafael J. Wysocki --- drivers/acpi/reboot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/reboot.c b/drivers/acpi/reboot.c index a6c77e8b..532dd6d 100644 --- a/drivers/acpi/reboot.c +++ b/drivers/acpi/reboot.c @@ -33,7 +33,7 @@ void acpi_reboot(void) switch (rr->space_id) { case ACPI_ADR_SPACE_PCI_CONFIG: /* The reset register can only live on bus 0. */ - bus0 = pci_find_bus(0, 0); + bus0 = pci_get_bus(0, 0); if (!bus0) return; /* Form PCI device/function pair. */ @@ -43,6 +43,7 @@ void acpi_reboot(void) /* Write the value that resets us. */ pci_bus_write_config_byte(bus0, devfn, (rr->address & 0xffff), reset_value); + pci_bus_put(bus0); break; case ACPI_ADR_SPACE_SYSTEM_MEMORY: