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: 5903961 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 38926BF440 for ; Fri, 27 Feb 2015 23:08:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67027202F2 for ; Fri, 27 Feb 2015 23:08:23 +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 7F70E202F0 for ; Fri, 27 Feb 2015 23:08:22 +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 1YRTz9-0001GG-FL; Fri, 27 Feb 2015 23:06:19 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YRTyR-0000uS-Fm for linux-arm-kernel@lists.infradead.org; Fri, 27 Feb 2015 23:05:36 +0000 Received: by pablf10 with SMTP id lf10so26188440pab.6 for ; Fri, 27 Feb 2015 15:05:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=isj89153zgxm3yMfP2Z9aPwxSUvbMoB7m2mFxnEQboM=; b=T0QzHMmfErZj3tHTOinOK1qMdq13Ibc/SfHMAFiaNqeBWOonDeMAOPy/THQgCKcYJF bn6H7mWmDIGNWvTp5UhUjwdKY2+l4a4n0sCF8I2gqDpabIO5RUeZl6eeCAueHlbMYFo1 hdk1hJZH66jfsHMGV05uibZBhr4pPFpRBzOaGfveMqrbht4Bue82OW6Kcz7YVTd5/jcW tHAXNDSI5u3V8Pnej+tOBHeIIiu/PAJS0otSoYaCXxK9MSsTQmuh5qLdZCbC9LhC8Esw 0rluRTlKLirD1hxPo2RMQJc1ZPwevNsAOPJ6qyqkc4V8JPoS6wayR2tNhtA/AIorxLYS VASA== X-Gm-Message-State: ALoCoQm+FT0vFsHnmZXbKWUQjnUxCGe2FKCuORoE2QAylaCW9XVMlIWicJL6/RsH6u7BboV/Ly9o 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150227_150535_576769_8084C554 X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Score: -0.7 (/) Cc: kaixu.xia@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, zhang.chunyan@linaro.org 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 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; } }