From patchwork Thu Sep 20 19:17:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 147127 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2375976ljw; Thu, 20 Sep 2018 12:18:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYNnRMDrG19sT7Aoncq+HX9iOeGOSMcJWcCoBWTR94Ly5oKbjfVb5++syjG2qH3iksQRFA4 X-Received: by 2002:a62:2b50:: with SMTP id r77-v6mr42484656pfr.51.1537471114362; Thu, 20 Sep 2018 12:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537471114; cv=none; d=google.com; s=arc-20160816; b=HuQMrGqHtDO+Pm//Th3U5soN5otGzKth2T9gDg8EQWeFMmifavmneKTdfsnt/SAenZ ainMOLoywKAswVVN+3pccmQTBZmbORljFhK7MWyGaCVdA5QoooyOm8IzD4v2y+eGSMHd 3woSh8UmDxjXcPTXTsFyYwF6yBg+HRhR0FcAvI9rFnL6CdHFt/AAnSWOVHeI6ePmyRko 9MsuI4Wx1sMeRqUgkCd6j99OjKk+MNhE8zTx8SJdianBLuO8GQJU++LU+1lrnaNsb2+h mEY6X7c+cw+ZA73ag2MCBrHWVFrtY9ooXyGyWIcteHsRl8ZHjBWCT2OXmV5pznFJvBUK 3YHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=se2ngb5czU9sEE2MR3i6PgGpYjHvr4Xt9ePRt1rOif0=; b=S0SIKjNRzINhGZdO5DAfquVUGg0XCCmhTAF7rwls4B/8L4gB7v9vgfyBQlR352Y1qs TvWvbdRygdQBfJMCbjr4321o0u825w0QSDVZ0CGYDCoLOQhFvAXYD+BfiFAOJfZmI7kc qZTRpftK4qZwzBjrrSxn2hXoByPrtdqo4FAo6YW10x7/U341ibbRwBqb43Zw1ju4d7oR +yXcVgOWGw0jph5IPoKfeNxOYjynk51M+UkhLLijRp6LnUgcTKujGCyC1frHUICvI0cb XW66WZFOeW8VWwDHYGifuJlKe3zLPMp0Fn/hc9nTn1BI30vMH6Oaa2ixBeSUzMSS5Y5P MYzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NXJTDcN5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k17-v6si25698121pfj.321.2018.09.20.12.18.34; Thu, 20 Sep 2018 12:18:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NXJTDcN5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388694AbeIUBDa (ORCPT + 32 others); Thu, 20 Sep 2018 21:03:30 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36591 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388617AbeIUBD3 (ORCPT ); Thu, 20 Sep 2018 21:03:29 -0400 Received: by mail-pf1-f196.google.com with SMTP id b11-v6so4830433pfo.3 for ; Thu, 20 Sep 2018 12:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=se2ngb5czU9sEE2MR3i6PgGpYjHvr4Xt9ePRt1rOif0=; b=NXJTDcN5ebVyQlFFv5G0Tf9cVLs4SmPg84ZTxuck0EW4c5RUEdZXPw9C5SNTJcquK9 4KuN3wE984ejX5g2b/fkRVejX82GSdlLiu7zubCwyH4sOceixPCYQaIPe4ipBXhJnf5b DMldrEu6UGBnu/IGdnI4UkRWmqVVYdaLY8YNg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=se2ngb5czU9sEE2MR3i6PgGpYjHvr4Xt9ePRt1rOif0=; b=Zo0/glb0zAabEHDAeaH/kQCKTbfRiqWcZqnYGM5fpo5JFLG5pj98EtJUDG8pqSiFZw JJVvWoqLCCMU32NFPUO69nFSqd+faFYVVLPt+1AXN+RnLu1o271eVgobhtZ7UMU/VCeO RoUufUR7GTcFw989eH9ZUJEImj7YoS5JXkevwRBIiFHCJwFgDY2aWs0Ii1tCqEKJln9x KDBpAWaUFygQgGoe3GJCJw+XEFCTZyTAsvXkLLSTR+N72mqO/aHFlcRyp2R4ywA+ajz1 ++iEb/Byf6CcNoh4h+YoIxrflYYGciuGlz0z4MU/thhmiW+A8sliJLCVF2HXjoZZ/4Rv c73Q== X-Gm-Message-State: APzg51ALc/QPbWE0GDuspxZv1Jj5s8A1UL00xxk8drRJumtoEEohGGyp t8/vVxyfX7VbKT23FamGVK/szw== X-Received: by 2002:a63:df04:: with SMTP id u4-v6mr39015149pgg.434.1537471110752; Thu, 20 Sep 2018 12:18:30 -0700 (PDT) Received: from localhost.localdomain ([209.121.128.187]) by smtp.gmail.com with ESMTPSA id k13-v6sm4424443pgf.37.2018.09.20.12.18.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Sep 2018 12:18:29 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 06/44] coresight: Add helper to check if the endpoint is input Date: Thu, 20 Sep 2018 13:17:41 -0600 Message-Id: <1537471099-19781-7-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537471099-19781-1-git-send-email-mathieu.poirier@linaro.org> References: <1537471099-19781-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suzuki K Poulose Add a helper to check if the given endpoint is input. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/of_coresight.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c index 2ecdd1432b5c..44903d35009f 100644 --- a/drivers/hwtracing/coresight/of_coresight.c +++ b/drivers/hwtracing/coresight/of_coresight.c @@ -45,6 +45,11 @@ of_coresight_get_endpoint_device(struct device_node *endpoint) endpoint, of_dev_node_match); } +static inline bool of_coresight_ep_is_input(struct device_node *ep) +{ + return of_property_read_bool(ep, "slave-mode"); +} + static void of_coresight_get_ports(const struct device_node *node, int *nr_inport, int *nr_outport) { @@ -56,7 +61,7 @@ static void of_coresight_get_ports(const struct device_node *node, if (!ep) break; - if (of_property_read_bool(ep, "slave-mode")) + if (of_coresight_ep_is_input(ep)) in++; else out++; @@ -213,7 +218,7 @@ of_get_coresight_platform_data(struct device *dev, * No need to deal with input ports, as processing the * output ports connected to them will process the details. */ - if (of_find_property(ep, "slave-mode", NULL)) + if (of_coresight_ep_is_input(ep)) continue; ret = of_coresight_parse_endpoint(dev, ep, pdata, i);