From patchwork Mon Mar 30 20:13:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 46541 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6FBF2218BE for ; Mon, 30 Mar 2015 20:16:33 +0000 (UTC) Received: by lbbug6 with SMTP id ug6sf22314556lbb.3 for ; Mon, 30 Mar 2015 13:16:32 -0700 (PDT) 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=O48menBbt2h+kcBXLeM5apBJiLMGWX7Muzi8+mP4y3bspc7nxJUkhbWrDcbX9bfY0X I2JZzXe1D4dGkjESHS89UaUzEuUA2a2599fGPXU4DEhVlssAk8hwL58z+zzbraGvASq5 aU1nlKgyvMb+tQ8B3NIxc42UEmj06Y7RACTziCBEHkF7EQg3gzoXrPdu7lZWZgmRhsxa bzPbk5XAiJbI+HmY48uZQCQTS+m7e+/Qz4VlDvktm647vAtnzK4z8yVuGJXE16R6SbwI uzhgEsG21WSb3eQHiXilPaf25tqyg3xcDniLy19/TGEE1XQ9H5M6SYpthkOA/hAff1Cv nd+Q== X-Gm-Message-State: ALoCoQk100Bn/FDvq9gFh43jWIKnedu8muRJdV9TsgdCjGmw2xB/8sqlfYFeJ04sxdqRlnubQguQ X-Received: by 10.112.130.71 with SMTP id oc7mr3421378lbb.13.1427746592435; Mon, 30 Mar 2015 13:16:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.198 with SMTP id ao6ls573901lac.103.gmail; Mon, 30 Mar 2015 13:16:32 -0700 (PDT) X-Received: by 10.112.155.65 with SMTP id vu1mr27882535lbb.61.1427746592196; Mon, 30 Mar 2015 13:16:32 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id si10si7736329lac.20.2015.03.30.13.16.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2015 13:16:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbug6 with SMTP id ug6so103342604lbb.3 for ; Mon, 30 Mar 2015 13:16:31 -0700 (PDT) X-Received: by 10.112.150.39 with SMTP id uf7mr27638473lbb.72.1427746591775; Mon, 30 Mar 2015 13:16:31 -0700 (PDT) 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.57.201 with SMTP id k9csp1367450lbq; Mon, 30 Mar 2015 13:16:30 -0700 (PDT) X-Received: by 10.66.231.7 with SMTP id tc7mr61168955pac.61.1427746590049; Mon, 30 Mar 2015 13:16:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si16124831pbz.221.2015.03.30.13.16.28; Mon, 30 Mar 2015 13:16:30 -0700 (PDT) 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 S1754443AbbC3UQZ (ORCPT + 27 others); Mon, 30 Mar 2015 16:16:25 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34488 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753858AbbC3UNx (ORCPT ); Mon, 30 Mar 2015 16:13:53 -0400 Received: by pactp5 with SMTP id tp5so10713981pac.1 for ; Mon, 30 Mar 2015 13:13:52 -0700 (PDT) X-Received: by 10.66.136.48 with SMTP id px16mr62026160pab.89.1427746432868; Mon, 30 Mar 2015 13:13:52 -0700 (PDT) Received: from t430.cg.shawcable.net ([184.64.168.246]) by mx.google.com with ESMTPSA id jy9sm11549978pbc.31.2015.03.30.13.13.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Mar 2015 13:13:52 -0700 (PDT) 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, mathieu.poirier@linaro.org Subject: [PATCH 1/8] coresight: making cpu index lookup arm64 compliant Date: Mon, 30 Mar 2015 14:13:34 -0600 Message-Id: <1427746421-31360-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427746421-31360-1-git-send-email-mathieu.poirier@linaro.org> References: <1427746421-31360-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.181 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; } }