From patchwork Sun May 26 15:53:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2616571 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 449E9DFB79 for ; Sun, 26 May 2013 16:01:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754397Ab3EZP6w (ORCPT ); Sun, 26 May 2013 11:58:52 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:62397 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754380Ab3EZP6u (ORCPT ); Sun, 26 May 2013 11:58:50 -0400 Received: by mail-pa0-f44.google.com with SMTP id wp1so3418962pac.31 for ; Sun, 26 May 2013 08:58:50 -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=ghkJLjF98LXvxM7A+kgt/FeFlBbyf5GkqyYLqfh0vvA=; b=Bi4efQju18bSRs5YvR2bkCQCfLVdOoXSZQ4GR7gQtDlKAR8Bi7KtvNazkuAm297G1h ozH09GbT3Nh89ghDZlH6b36BBriiCfdYCnZhzPQQqUzCkcePhb2UJ467cIfRRmgTH55a 0HvxY5+Y9RYQBWW8cGga0CRTkxN3zmkDzo9b4ptX+GsKSNCD5Ve8pYd6j0ryXICoacbD QSW6OBv+RKd+qsohs/GYBkVJ/DfpNp6ycWPb/Z2fgEWRZXKGuwz6ltVtFs0O1k1iyPSc eMO3PgdthgliRsRYZQVwJBVhdIQ58UQvSR7btYD/xRQ6EVNPmYpzAc7S+6ZuxNJagit7 m6Ow== X-Received: by 10.68.189.105 with SMTP id gh9mr25807100pbc.77.1369583930392; Sun, 26 May 2013 08:58:50 -0700 (PDT) Received: from localhost.localdomain ([111.196.197.202]) by mx.google.com with ESMTPSA id ze11sm26603189pab.22.2013.05.26.08.58.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 May 2013 08:58:49 -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: [PATCH v3, part2 13/20] PCI, ACPI: use hotplug-safe iterators to walk PCI buses Date: Sun, 26 May 2013 23:53:10 +0800 Message-Id: <1369583597-3801-14-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369583597-3801-1-git-send-email-jiang.liu@huawei.com> References: <1369583597-3801-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 Acked-by: Rafael J. Wysocki Cc: Len Brown Cc: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- 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: