From patchwork Tue Feb 3 18:52:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 44275 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1EFEB2034D for ; Tue, 3 Feb 2015 18:53:18 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id l61sf22107058wev.0 for ; Tue, 03 Feb 2015 10:53:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=bKp9rjebn2yK+67Gi8JdPV/SgO/EBb5IgXWnND41ibY=; b=i4TEWkTjOD7yuRBqx6B9k8ppREV5/DxEpocXB2HEURiEwmyJ35LlisTrA1UTwiZ53A Hqz+ZoK6WxVSKc9j7lZhIgkeOPg6/J2/uNxslEgiLny6lvFAkC3XK7ryskf61hpVB0a9 ebmZUmbagfWXzl8WU4nkTTlYa9xHgF0vl41t1t3iBc2tGEQigZUdjJHzNncNEbr9wodA 5QKoOoMnJ8PXL82ypQVWisfnuF/2+2go7pa3NvTb5V9Eq2uMVOec190Pl/+wdSPQgoaz myHbPlGIiuXOyeSXdt2bi1aSNwmygoK2yqNxluVHAmUPfNNU42Jqng+N53FhjVe4BAzv IStQ== X-Gm-Message-State: ALoCoQkDSDhrKCv9bsZQwQ0pKP8nCAVm5CHae6mOZNHOGVbdU0poZMjB4p2rzjsVHe5WsN7pavUO X-Received: by 10.112.124.142 with SMTP id mi14mr2501330lbb.1.1422989597312; Tue, 03 Feb 2015 10:53:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.193 with SMTP id v1ls305597lag.102.gmail; Tue, 03 Feb 2015 10:53:17 -0800 (PST) X-Received: by 10.112.122.52 with SMTP id lp20mr19960827lbb.98.1422989597127; Tue, 03 Feb 2015 10:53:17 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id jd8si20013650lbc.99.2015.02.03.10.53.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 10:53:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id gf13so53874900lab.8 for ; Tue, 03 Feb 2015 10:53:17 -0800 (PST) X-Received: by 10.112.181.41 with SMTP id dt9mr26088529lbc.56.1422989596849; Tue, 03 Feb 2015 10:53:16 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp18938lbj; Tue, 3 Feb 2015 10:53:16 -0800 (PST) X-Received: by 10.70.56.34 with SMTP id x2mr40225868pdp.127.1422989595198; Tue, 03 Feb 2015 10:53:15 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tt1si3513632pab.169.2015.02.03.10.53.14; Tue, 03 Feb 2015 10:53:15 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966324AbbBCSxL (ORCPT + 29 others); Tue, 3 Feb 2015 13:53:11 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:39687 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965956AbbBCSxH (ORCPT ); Tue, 3 Feb 2015 13:53:07 -0500 Received: by mail-pa0-f42.google.com with SMTP id bj1so99712026pad.1 for ; Tue, 03 Feb 2015 10:53:06 -0800 (PST) X-Received: by 10.68.69.111 with SMTP id d15mr8468087pbu.36.1422989585307; Tue, 03 Feb 2015 10:53:05 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [70.73.24.112]) by mx.google.com with ESMTPSA id ih10sm2869846pbc.1.2015.02.03.10.53.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Feb 2015 10:53:04 -0800 (PST) From: mathieu.poirier@linaro.org To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] coresight: making cpu index lookup arm64 compliant Date: Tue, 3 Feb 2015 11:52:56 -0700 Message-Id: <1422989576-23277-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mathieu.poirier@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mathieu Poirier Function "get_logical_index()" is not available on arm64. Instead of adding the function simply using "of_get_cpu_node()" and comparing the return value with cpu handles yields the same result. Signed-off-by: Mathieu Poirier --- drivers/coresight/of_coresight.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/coresight/of_coresight.c b/drivers/coresight/of_coresight.c index c3efa418a86d..f3cc8e97a0f8 100644 --- a/drivers/coresight/of_coresight.c +++ b/drivers/coresight/of_coresight.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -113,7 +114,7 @@ static int of_coresight_alloc_memory(struct device *dev, struct coresight_platform_data *of_get_coresight_platform_data( struct device *dev, struct device_node *node) { - int i = 0, ret = 0; + int i = 0, ret = 0, cpu; struct coresight_platform_data *pdata; struct of_endpoint endpoint, rendpoint; struct device *rdev; @@ -187,17 +188,10 @@ struct coresight_platform_data *of_get_coresight_platform_data( /* Affinity defaults to CPU0 */ pdata->cpu = 0; dn = of_parse_phandle(node, "cpu", 0); - if (dn) { - const u32 *cell; - int len, index; - u64 hwid; - - cell = of_get_property(dn, "reg", &len); - if (cell) { - hwid = of_read_number(cell, of_n_addr_cells(dn)); - index = get_logical_index(hwid); - if (index != -EINVAL) - pdata->cpu = index; + for (cpu = 0; dn && cpu < nr_cpu_ids; cpu++) { + if (dn == of_get_cpu_node(cpu, NULL)) { + pdata->cpu = cpu; + break; } }