From patchwork Thu Sep 20 07:21:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1483051 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 54343DF2D2 for ; Thu, 20 Sep 2012 07:24:12 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEb5I-0002QE-Gf; Thu, 20 Sep 2012 07:22:04 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEb5E-0002Pa-AH for linux-arm-kernel@lists.infradead.org; Thu, 20 Sep 2012 07:22:01 +0000 Received: from mailbox.adnet.avionic-design.de (mailbox.avionic-design.de [109.75.18.3]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0MZb69-1Sw6ta3xtd-00LAPC; Thu, 20 Sep 2012 09:21:56 +0200 Received: from localhost (localhost [127.0.0.1]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id 53EC52A282F4; Thu, 20 Sep 2012 09:21:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at avionic-design.de Received: from mailbox.adnet.avionic-design.de ([127.0.0.1]) by localhost (mailbox.avionic-design.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5F5jJdJSDJTL; Thu, 20 Sep 2012 09:21:54 +0200 (CEST) Received: from localhost (avionic-0098.adnet.avionic-design.de [172.20.31.233]) (Authenticated sender: thierry.reding) by mailbox.adnet.avionic-design.de (Postfix) with ESMTPA id 1BBE22A28183; Thu, 20 Sep 2012 09:21:54 +0200 (CEST) From: Thierry Reding To: Russell King Subject: [PATCH v2 2/2] ARM: pci: Allow passing per-controller private data Date: Thu, 20 Sep 2012 09:21:50 +0200 Message-Id: <1348125710-28726-3-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1348125710-28726-1-git-send-email-thierry.reding@avionic-design.de> References: <1348125710-28726-1-git-send-email-thierry.reding@avionic-design.de> X-Provags-ID: V02:K0:yFg2sZ6WxDnIMWoVytGKNqv0XTMphWuCuUOqJVXZI/M GaeHuFq5iAsFTrNUuD0mEoomEamAHiv5IMXCjl+2BvRvkBhClo HwaP1zwpz1TRkl6ghnsf5rp4V+ZUs3wNWSGiP4d3Sh1njibmS2 AUMwhDc1LN066IMY76YfKvOvyLuLpt/Ke9ZeYAyhL0/ZRgZfXw f1d7j0pCPlusGZWvddN/VBEKnRzQebmj4ED5i7XMcc2N9LYmf3 g8ypaj6uzCJP8PvSa4erKwnas/3bW2UmfPmuJ79ripAatoeeqz kJSM2k/q3WkEYAXTimjkGWpNFZxxZHkV+kFGkZPHpmWiSjv8R2 BkKgVkyp+27qvXpkR1jhEJN8BCg7yBz1cacai8CAtO3oA/B420 6o8s0vMFevddVJ7rfWdWy5mKNCtY3fFikvRmpR6OLZlhmDeR+Y vWvDA X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.9 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In order to allow drivers to specify private data for each controller, this commit adds a private_data field to the struct hw_pci. This field is an array of nr_controllers pointers that will be used to initialize the private_data field of the corresponding controller's pci_sys_data structure. Signed-off-by: Thierry Reding --- arch/arm/include/asm/mach/pci.h | 1 + arch/arm/kernel/bios32.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index 26c511f..736cb8d 100644 --- a/arch/arm/include/asm/mach/pci.h +++ b/arch/arm/include/asm/mach/pci.h @@ -21,6 +21,7 @@ struct hw_pci { #endif struct pci_ops *ops; int nr_controllers; + void **private_data; int (*setup)(int nr, struct pci_sys_data *); struct pci_bus *(*scan)(int nr, struct pci_sys_data *); void (*preinit)(void); diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 6f1d75f..d69bf81 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -442,6 +442,9 @@ static void pcibios_init_hw(struct hw_pci *hw, struct list_head *head) sys->map_irq = hw->map_irq; INIT_LIST_HEAD(&sys->resources); + if (hw->private_data) + sys->private_data = hw->private_data[nr]; + ret = hw->setup(nr, sys); if (ret > 0) {