From patchwork Thu Sep 20 07:43:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1483141 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 E17023FE65 for ; Thu, 20 Sep 2012 07:46:47 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEbQf-0006zA-5v; Thu, 20 Sep 2012 07:44:09 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEbQO-0006vx-Kf for linux-arm-kernel@lists.infradead.org; Thu, 20 Sep 2012 07:43:55 +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 0Lowim-1TkNvv2Noi-00f1KT; Thu, 20 Sep 2012 09:43:51 +0200 Received: from localhost (localhost [127.0.0.1]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id D7BE72A28183; Thu, 20 Sep 2012 09:43:50 +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 m+jOY-Akkia8; Thu, 20 Sep 2012 09:43:49 +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 965042A282F7; Thu, 20 Sep 2012 09:43:49 +0200 (CEST) From: Thierry Reding To: Russell King Subject: [PATCH v3 2/2] ARM: pci: Allow passing per-controller private data Date: Thu, 20 Sep 2012 09:43:45 +0200 Message-Id: <1348127025-29461-3-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1348127025-29461-1-git-send-email-thierry.reding@avionic-design.de> References: <1348127025-29461-1-git-send-email-thierry.reding@avionic-design.de> X-Provags-ID: V02:K0:7c6MoA0dLGYKrnOxXNR3s+MmlJCtgkKL3xIGpWvXlx6 b81/Rw8pEoEelQqtieieeJUREwRBaeT78cWgYBK6YwHHnyZqZk +gCxbFbb+Usn5YuZnPc2q7IICms1xtlDApupqB90lB7DSQcQOI H1eJlUgvjNocRIjM79A0Jr/YnDwIiEnuY300B9rcgXHmXfWcG0 9snOpO+H87LUNMnzT53OryGavGI/85tbNSz0wtI5jqCDELcd8N rFGwe+Ck2pvEj+LnHrdb2BvdCQhFzJj9CZk5XRMLOEE3o8kXsQ S95v2c1Y2PdaYjp7WXllRN1MaZLgIi9HoNpj6GVdwF85CHMOnS WUa5WJNgFSYrjijQcLrJiA5eRKMFRb2bdrrdHTVikRQZPjyIZW hz3ePD9AWt+OAFRuDgrU3dmVovA/f6EKIhaFI8USIxwlhcl/6i TxDK4 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-pci@vger.kernel.org, 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 db9fedb..5cf2e97 100644 --- a/arch/arm/include/asm/mach/pci.h +++ b/arch/arm/include/asm/mach/pci.h @@ -23,6 +23,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 2c80f36..88da2d4 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -475,6 +475,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) {