From patchwork Wed May 13 16:12:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 6398571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 301479F1C2 for ; Wed, 13 May 2015 16:29:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 645EC20439 for ; Wed, 13 May 2015 16:29:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D5EA20437 for ; Wed, 13 May 2015 16:29:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YsZU9-0004f7-NJ; Wed, 13 May 2015 16:26:17 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YsZHW-0000Uf-8n for linux-arm-kernel@lists.infradead.org; Wed, 13 May 2015 16:13:14 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 66B7E614; Wed, 13 May 2015 09:12:15 -0700 (PDT) Received: from leverpostej.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1C9603F21B; Wed, 13 May 2015 09:12:50 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/7] arm: perf: make of_pmu_irq_cfg take arm_pmu Date: Wed, 13 May 2015 17:12:24 +0100 Message-Id: <1431533549-27715-3-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431533549-27715-1-git-send-email-mark.rutland@arm.com> References: <1431533549-27715-1-git-send-email-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150513_091314_431880_60DA4749 X-CRM114-Status: UNSURE ( 8.49 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: mark.rutland@arm.com, lorenzo.pieralisi@arm.com, peterz@infradead.org, will.deacon@arm.com, liviu.dudau@arm.com, linux-kernel@vger.kernel.org, acme@kernel.org, mingo@redhat.com, paulus@samba.org, sudeep.holla@arm.com, drew.richardson@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To support multiple PMUs we'll need to pass the arm_pmu instance around. Update of_pmu_irq_cfg to take an arm_pmu, and acquire the platform device from this. Signed-off-by: Mark Rutland Acked-by: Will Deacon --- arch/arm/kernel/perf_event_cpu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c index 91c7ba1..2a9003e 100644 --- a/arch/arm/kernel/perf_event_cpu.c +++ b/arch/arm/kernel/perf_event_cpu.c @@ -301,9 +301,10 @@ static int probe_current_pmu(struct arm_pmu *pmu) return ret; } -static int of_pmu_irq_cfg(struct platform_device *pdev) +static int of_pmu_irq_cfg(struct arm_pmu *pmu) { int i; + struct platform_device *pdev = pmu->plat_device; int *irqs = kcalloc(pdev->num_resources, sizeof(*irqs), GFP_KERNEL); if (!irqs) @@ -336,7 +337,7 @@ static int of_pmu_irq_cfg(struct platform_device *pdev) } if (i == pdev->num_resources) - cpu_pmu->irq_affinity = irqs; + pmu->irq_affinity = irqs; else kfree(irqs); @@ -368,7 +369,7 @@ static int cpu_pmu_device_probe(struct platform_device *pdev) if (node && (of_id = of_match_node(cpu_pmu_of_device_ids, pdev->dev.of_node))) { init_fn = of_id->data; - ret = of_pmu_irq_cfg(pdev); + ret = of_pmu_irq_cfg(pmu); if (!ret) ret = init_fn(pmu); } else {