From patchwork Fri Sep 14 21:11:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1460281 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 6CDFCDF280 for ; Fri, 14 Sep 2012 21:15:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TCdAy-0006nK-4D; Fri, 14 Sep 2012 21:11:48 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TCdAi-0006mb-5n for linux-arm-kernel@lists.infradead.org; Fri, 14 Sep 2012 21:11:38 +0000 Received: from mailbox.adnet.avionic-design.de (mailbox.avionic-design.de [109.75.18.3]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Lsfxh-1TeuTy1EVt-012KEV; Fri, 14 Sep 2012 23:11:23 +0200 Received: from localhost (localhost [127.0.0.1]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id B252E2A28304; Fri, 14 Sep 2012 23:11:22 +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 wuLkT1NpuuoU; Fri, 14 Sep 2012 23:11:21 +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 692A42A282C9; Fri, 14 Sep 2012 23:11:21 +0200 (CEST) From: Thierry Reding To: Russell King Subject: [PATCH 2/2] ARM: pci: Allow passing per-controller private data Date: Fri, 14 Sep 2012 23:11:18 +0200 Message-Id: <1347657078-32230-3-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347657078-32230-1-git-send-email-thierry.reding@avionic-design.de> References: <1347657078-32230-1-git-send-email-thierry.reding@avionic-design.de> X-Provags-ID: V02:K0:jJ4e3rQerPYB3n6zHx4Lc4yTYsnfsprxeaOlVca//rw xi1Afl6aqCcL2xRddnW5i2IfT9OQ3cuSkVwNDTrW1z+Ey9k2MS Llpb7JI7/66m7Fi/peeQ7bkM/h2s+ZniQnOcrFWNHULNefnWua O49ERjQ1JzXOCAK9oVTcFJAZNoc+8hs2yITnkNs/j6DSIrhgTP e0T6u8sV9MaanBo5fpmQwwx/04WQDZpe7pM0ZSI+v97jU540S3 UqwkLTUXQgOzZDQFXM/v/1GktBU2cMJvFmhl3WRufB74pbf9CI yIQkHtnn5JKat/+5ZZR1V/J3oz23mcPKkzJkcjY19FQh/RzyAO JBI9JmaPhtTrj/zTFmTFPbEYxgOqD83wWrr9ois5Vr+syawyK4 nUS7NFmmGyM31iy7hn0ZMV1iQxOeihDR3yDQ7peXprQWIdU8vf ZVaAb 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 7288093..07a38d8 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -442,6 +442,9 @@ static void __devinit 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) {