From patchwork Thu Jul 26 19:55:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1244681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id EE18C3FDCA for ; Thu, 26 Jul 2012 20:06:22 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SuUEa-0004HT-7x; Thu, 26 Jul 2012 20:00:34 +0000 Received: from moutng.kundenserver.de ([212.227.126.171]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SuU9l-00043l-07 for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2012 19:55:33 +0000 Received: from mailbox.adnet.avionic-design.de (mailbox.avionic-design.de [109.75.18.3]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0Ltj6n-1TuoAT3rLJ-011ETy; Thu, 26 Jul 2012 21:55:17 +0200 Received: from localhost (localhost [127.0.0.1]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id 37C572A282EA; Thu, 26 Jul 2012 21:55:16 +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 Vdm4qyBkkmd0; Thu, 26 Jul 2012 21:55:15 +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 EFBD22A28306; Thu, 26 Jul 2012 21:55:14 +0200 (CEST) From: Thierry Reding To: linux-tegra@vger.kernel.org Subject: [PATCH v3 03/10] ARM: pci: Allow passing per-controller private data Date: Thu, 26 Jul 2012 21:55:05 +0200 Message-Id: <1343332512-28762-4-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1343332512-28762-1-git-send-email-thierry.reding@avionic-design.de> References: <1343332512-28762-1-git-send-email-thierry.reding@avionic-design.de> X-Provags-ID: V02:K0:3K30KJzH05KoDQkiOxH0CDTaZGjPnJMM++51c88hp28 rOi+zRRnheook02gtoMmvt9VnZCrUOR28XLCXvYEksnqN9vc6Q MYy2G33o6v70JyFzBAP5IqACm3BHMj9B3Sx4BeMzM6QEKNqg3O Bywaw6JJj+67r8yp2xmdxhbtbL2JfB8nrHB+5/aklB/LZexsd8 EQdPh27gD2oRSrZc+JSzXkMmad/rt9mOjltitq7Iy+TSCxnPWK /mTPrlr2BasgciEuNeYnGxorE3bF2p194BfdzNd/aHYTn2fNq9 fXILRq6wAWXsJIcomX7wBWHI6yqul/CbJHUjKeBMNO7pAH1MnA es7pw2NW2xvpkGlrnv09ROtivkwTGswLTzzjkrkVelpuNmCVKt kvIO/a3wrdLA3pwUsN37XDO1kv5SH5Dsu8YVRHwfFStcQwxFdc aodEM X-Spam-Note: CRM114 invocation failed X-Spam-Note: SpamAssassin invocation failed Cc: Mitch Bradley , Russell King , Arnd Bergmann , Stephen Warren , linux-pci@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Rob Herring , Grant Likely , Olof Johansson , Colin Cross , Bjorn Helgaas , 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 --- Changes in v3: - none Changes in v2: - new patch 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 188fd58..31fab93 100644 --- a/arch/arm/include/asm/mach/pci.h +++ b/arch/arm/include/asm/mach/pci.h @@ -24,6 +24,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 5c3dd59..897b21a 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -475,6 +475,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) {