Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D66BC433F5 for ; Wed, 29 Sep 2021 08:42:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F633613A6 for ; Wed, 29 Sep 2021 08:42:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6F633613A6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C2F66E9F7; Wed, 29 Sep 2021 08:42:46 +0000 (UTC) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE5F46E9F7 for ; Wed, 29 Sep 2021 08:42:45 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 96C6A3201124; Wed, 29 Sep 2021 04:42:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 29 Sep 2021 04:42:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=YeZoYhoLBnI/P hLkXsYpsONnRE4tJxGHMKmgk564N80=; b=Pj3Si0HzKxT9XpRI8/sIgEQfu4dV3 6Nvyyhjo4ryYETD8+M4zlLBNFlm3wY9cqcJ9a6Fr9XMYug9uMZ6zP2H4rkT+F2f8 Nqgg2K4uI6wae1lOTuIQmzzrogkMm+sT6Zp6pW0W+IEa3ril31MV9yF2vpQH5SeV c7vdxCIFGFHkL80g1gytQhli9JoTGwA3de6FG1uzTXiXibtYuR0jnBRASMsV2a5u rCeYslbOaPu0F2358XFTTFbfhDzxHuhznlsbeTjfPZTQj0yxv+yrRMXiqMcAtPXC Jvtckd/umxlczvUrXv0nBZEztm8x6Z9iiT/TJiM2HkQ6f0xB8ENFh8D5g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=YeZoYhoLBnI/PhLkXsYpsONnRE4tJxGHMKmgk564N80=; b=HrKXdRYs X6oeZUquuntYYL2iOCueHNCaVkIMCqlrNdOuwecudbfi/woHz8IYo4mCudOE3Hcv Zur7EDAI7nVDsDAJkiFcTuJ3Evn45eeG5bhZL1Cs7GvnWWDu6ZjHt8Iu/YUP5k3k YpcepeRL9z8QeF01JCSfbV2BUn4Ur0e3zWZBYvNN5m1sJcOkS2CqH9HZqN0QHN+w YzhdnGHiRpGbWm45UEKhaJw6xoOpgcguMWbA4Ckkne7LUxbWkh7zK0GRcDXP2ZDP nhr4jqWnQ2eiX1vSIEFPT1KvhC6v//VkzFr4y3J6RdydepWhHpVHdswtM8sXePe+ yre3OeoHHMMWNg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekvddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 29 Sep 2021 04:42:41 -0400 (EDT) From: Maxime Ripard To: Rob Herring , Frank Rowand , Chen-Yu Tsai , Maxime Ripard , =?UTF-8?q?Jernej=20=C5=A0krabec?= , Daniel Vetter , David Airlie , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 1/7] of: Make of_graph_get_port_by_id take a const device_node Date: Wed, 29 Sep 2021 10:42:28 +0200 Message-Id: <20210929084234.1271915-2-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210929084234.1271915-1-maxime@cerno.tech> References: <20210929084234.1271915-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" of_graph_get_port_by_id doesn't modify the device_node pointer it takes as argument, so we can make it const. Signed-off-by: Maxime Ripard --- drivers/of/property.c | 2 +- include/linux/of_graph.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index 3fd74bb34819..739d5d1c8c3a 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -603,7 +603,7 @@ EXPORT_SYMBOL(of_graph_parse_endpoint); * Return: A 'port' node pointer with refcount incremented. The caller * has to use of_node_put() on it when done. */ -struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id) +struct device_node *of_graph_get_port_by_id(const struct device_node *parent, u32 id) { struct device_node *node, *port; diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index 4d7756087b6b..87f3f4d0d0df 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -42,7 +42,7 @@ bool of_graph_is_present(const struct device_node *node); int of_graph_parse_endpoint(const struct device_node *node, struct of_endpoint *endpoint); int of_graph_get_endpoint_count(const struct device_node *np); -struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id); +struct device_node *of_graph_get_port_by_id(const struct device_node *node, u32 id); struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, struct device_node *previous); struct device_node *of_graph_get_endpoint_by_regs( @@ -74,7 +74,7 @@ static inline int of_graph_get_endpoint_count(const struct device_node *np) } static inline struct device_node *of_graph_get_port_by_id( - struct device_node *node, u32 id) + const struct device_node *node, u32 id) { return NULL; } -- 2.31.1