From patchwork Wed Sep 29 08:42:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12524913 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 55739C433F5 for ; Wed, 29 Sep 2021 08:45:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 209026128E for ; Wed, 29 Sep 2021 08:45:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 209026128E 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.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8rQhPItybTQlHYflobLOZznhbnnTuakKTfMLLL3tayc=; b=NM2jrAHYZ2mUTJ S0K6aJVQmxidNndzjwvgHwfT8zkrvdPzisnfs2y0EDiI+ZtX0bPPZOKUATwRZQpFcng5ZPyc/3bL9 39NhzgqDNUVyw1eyw2n1Qm22tvhYqmvCoHkKagtJW1LbLSKtmJg1J+ZxXkERrynSb/3uIZzGWVlbT hOAmbBBIrliC4QXDel41CCnq6iV8S1poaxRDnzWum0qqRmf5hncH2OA7jT5Dh5dZsXxPdqfI/ISzo 8T7yjdIuUCXizH2Vjb+UgQRyCGqclKi3pPYbOQQ2+owTaRgi+PEYmr3KA4HBzGkyqSvLzX2Ju5sjW j1ROHLwtUavIk6xGoOmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVVB6-00ATQz-9c; Wed, 29 Sep 2021 08:43:00 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVVAr-00ATMI-Td for linux-arm-kernel@lists.infradead.org; Wed, 29 Sep 2021 08:42:47 +0000 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_=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210929_014246_003650_5F37495C X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; }