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: 1483121 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D221F3FE65 for ; Thu, 20 Sep 2012 07:44:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753707Ab2ITHn7 (ORCPT ); Thu, 20 Sep 2012 03:43:59 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:52203 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504Ab2ITHn4 (ORCPT ); Thu, 20 Sep 2012 03:43:56 -0400 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 Cc: Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org 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 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.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) {