From patchwork Fri Feb 27 23:04:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 45273 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 03B4020674 for ; Fri, 27 Feb 2015 23:07:22 +0000 (UTC) Received: by wibbs8 with SMTP id bs8sf2314862wib.2 for ; Fri, 27 Feb 2015 15:07:21 -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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=+slYcnOAIiYlE8EPDwzuGHU7ZA1iq/bQU1VKYM7IaDw=; b=bOQg1R5jdFj68/G/lw/YvslVLVmXnWBtc/g4dngAZtZZQk+nxpNitS2pzQAdpMoxTY Y0SHsSYR6I83dSRvjf3bthqmAn8FpTFlfBa2YEwFWD2emKBUCmz6RIZqnIKoeo/qRtbd Ee4sg5ixmRLU+uc6xG8SYlf67NqOdxF02iq8yQOHyYcceBCftLAS1i363PjMKvs797zm Le1hi0NgmaI3bXku3qBrTDTLHTrJYaAp4j4kEfahIm6wJF+HywwVprkFoPB1oDsYt6tQ Yv54SdShp1dFvQhyLqv2cHIjuJYa89hFLnxLlT6bV3LlrJBLr9JcS4m/+SxAR4KCMP/Q Okdw== X-Gm-Message-State: ALoCoQmDnlbCF+cgrYJLIRdB0+PjeZSzkDXkenv5+EwSB5rg2SluULZGig4PmyMHj6jrgiKCSwMj X-Received: by 10.180.101.101 with SMTP id ff5mr810918wib.5.1425078441336; Fri, 27 Feb 2015 15:07:21 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.2 with SMTP id iq2ls226962lac.100.gmail; Fri, 27 Feb 2015 15:07:20 -0800 (PST) X-Received: by 10.152.27.164 with SMTP id u4mr5857299lag.45.1425078440945; Fri, 27 Feb 2015 15:07:20 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id w6si3866402lbf.153.2015.02.27.15.07.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 15:07:20 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbiz11 with SMTP id z11so20163725lbi.8 for ; Fri, 27 Feb 2015 15:07:20 -0800 (PST) X-Received: by 10.152.21.100 with SMTP id u4mr14569024lae.41.1425078440624; Fri, 27 Feb 2015 15:07:20 -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 h5csp4208281lbj; Fri, 27 Feb 2015 15:07:19 -0800 (PST) X-Received: by 10.68.69.36 with SMTP id b4mr28207583pbu.132.1425078438645; Fri, 27 Feb 2015 15:07:18 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uk6si5534499pbc.182.2015.02.27.15.07.17; Fri, 27 Feb 2015 15:07:18 -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 S1755843AbbB0XHL (ORCPT + 28 others); Fri, 27 Feb 2015 18:07:11 -0500 Received: from mail-pd0-f171.google.com ([209.85.192.171]:37739 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755275AbbB0XFN (ORCPT ); Fri, 27 Feb 2015 18:05:13 -0500 Received: by pdbfl12 with SMTP id fl12so24327090pdb.4 for ; Fri, 27 Feb 2015 15:05:13 -0800 (PST) X-Received: by 10.70.101.165 with SMTP id fh5mr28416111pdb.16.1425078313159; Fri, 27 Feb 2015 15:05:13 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [70.73.24.112]) by mx.google.com with ESMTPSA id jd10sm4990871pbd.23.2015.02.27.15.05.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Feb 2015 15:05:12 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, zhang.chunyan@linaro.org, kaixu.xia@linaro.org Subject: [PATCH 1/5] coresight: making cpu index lookup arm64 compliant Date: Fri, 27 Feb 2015 16:04:50 -0700 Message-Id: <1425078294-13059-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425078294-13059-1-git-send-email-mathieu.poirier@linaro.org> References: <1425078294-13059-1-git-send-email-mathieu.poirier@linaro.org> 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.217.170 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: , 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; } }