From patchwork Sun May 26 15:53:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 246418 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A7E502C0096 for ; Mon, 27 May 2013 02:00:11 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754683Ab3EZP7X (ORCPT ); Sun, 26 May 2013 11:59:23 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:60586 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754055Ab3EZP7U (ORCPT ); Sun, 26 May 2013 11:59:20 -0400 Received: by mail-pd0-f175.google.com with SMTP id 6so5405129pdd.6 for ; Sun, 26 May 2013 08:59:20 -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=4KMYQQ0QzZqqboDXz+0NMFuTNe3yg5xSXKXOEwMiNDw=; b=LANEIBMU9zk8Cv95LxDNcuWVVUJ/GSDs0OfT3dxDGFFV26sNXrwvpIauqp5Jdygcik S4I0O8DacBbUT/Hi6kDduLENl4apyFPfGrlntA04pmyFClt0MwhsHY4xJohvvFFUZMVv dqScnUzvUVjK28xaSG4TX05HguteyDyg6us+2UTcz0tcodsmfRKBP99yFaddbqq6TYbq WTfxWlEEwt6ltvb1StH0l5q9lN+3mweSnwStB4b9uh0yDYuP26bmZ336PLJofsLm/4XX eaZAn8+JZzaXCldd0ZAArgdl0xK7nPlhC0np0qh2lkcWGWIaZebAYXzIL07DYqKu6uGX f+LA== X-Received: by 10.66.149.170 with SMTP id ub10mr26362271pab.58.1369583960277; Sun, 26 May 2013 08:59:20 -0700 (PDT) Received: from localhost.localdomain ([111.196.197.202]) by mx.google.com with ESMTPSA id ze11sm26603189pab.22.2013.05.26.08.59.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 May 2013 08:59:19 -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, Corentin Chary , Matthew Garrett , acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org Subject: [PATCH v3, part2 18/20] PCI, eeepc-laptop: use hotplug-safe iterators to walk PCI buses Date: Sun, 26 May 2013 23:53:15 +0800 Message-Id: <1369583597-3801-19-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Enhance eeepc-laptop drvier to use hotplug-safe iterators to walk PCI buses. Signed-off-by: Jiang Liu Cc: Corentin Chary Cc: Matthew Garrett Cc: acpi4asus-user@lists.sourceforge.net Cc: platform-driver-x86@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/platform/x86/eeepc-laptop.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 5d26e70..6291b4f 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -759,7 +759,7 @@ static struct hotplug_slot_ops eeepc_hotplug_slot_ops = { static int eeepc_setup_pci_hotplug(struct eeepc_laptop *eeepc) { int ret = -ENOMEM; - struct pci_bus *bus = pci_find_bus(0, 1); + struct pci_bus *bus = pci_get_bus(0, 1); if (!bus) { pr_err("Unable to find wifi PCI bus\n"); @@ -787,6 +787,8 @@ static int eeepc_setup_pci_hotplug(struct eeepc_laptop *eeepc) goto error_register; } + pci_bus_put(bus); + return 0; error_register: @@ -795,6 +797,7 @@ error_info: kfree(eeepc->hotplug_slot); eeepc->hotplug_slot = NULL; error_slot: + pci_bus_put(bus); return ret; }