From patchwork Thu Sep 5 18:52:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 13792853 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EA615CE7A81 for ; Thu, 5 Sep 2024 19:00:47 +0000 (UTC) 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=eddoCWV2KZbJAmnCO4B+gknU+Vj9VtphCbD4QrGkUdA=; b=HZOXl8B//bN7Qe /S1b4FQ7FTsCVoTzfOnYJs7dEV+p/VgJ1emise8loucti7pGCwML+3vfWf9VqPUnenpElzPa5uBPk mRHLVbfyclGHi4zRF0tiftY6xeH9tKjtNChX6n7cP822LfMJSNuiSiPh2GxKT4LbiS7KC16AMbG0s RAA7C2M43RJpBinlj5qAn1YB/skGztW2rhqRBKW1Z3SPWODD4/4lXk3OeX3de50oqu2GbVXeWLzxO kLFx1MFWeWg63t5zOKw0s6ASDPPxQ4wWaApSwtQY+W0wH8XRY90b63ckoBMcGDBEkHHd1seIKnnt+ j0yq4DVfUTbjXJoUsczQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smHin-00000009WtB-0lhA; Thu, 05 Sep 2024 19:00:45 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smHbA-00000009UxY-3RX0; Thu, 05 Sep 2024 18:52:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=EBMUNEsgg3HNHWKY+I4PZ0QO6FHi+iK8X6AqrZyqPbo=; b=MafLyMVKQPzVlTRwKI9hWGEGJy ipJaNMmahZM9kb4bry+d6315QlbuUSD3hGlkr3m9T2eJAKAZeXSLufi+aFpMjZIAQymKE4UnxwJHw jdAFvtLfLvhe79o/cOk3ngehe9RWW4KdB8HnUKFWnaCv65663y05gk9Q1uVjF7+NII2I1Nwg7p3zV W4sNNhKJhFMsQ21pmODmaJ5FdO85UaBUN0q0swZIxx1/vVq/nLulVB2aw4nyBOBaIlGTjDblCxS2g w0CpX36Ly3sQF7YqTvN7mfDypn/bQmKj8ku8WrpZZa8loGsh5HqvgCaNh1wDN8x4xjbcz9w1VshhF RKRO9eBQ==; Received: from i5e860d0f.versanet.de ([94.134.13.15] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smHaw-0003sR-L9; Thu, 05 Sep 2024 20:52:38 +0200 From: Heiko Stuebner To: lee@kernel.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, jdelvare@suse.com, linux@roeck-us.net, heiko@sntech.de, dmitry.torokhov@gmail.com, pavel@ucw.cz, ukleinek@debian.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH v7 1/8] mfd: core: make platform_data pointer const in struct mfd_cell Date: Thu, 5 Sep 2024 20:52:25 +0200 Message-ID: <20240905185232.2899464-2-heiko@sntech.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240905185232.2899464-1-heiko@sntech.de> References: <20240905185232.2899464-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_115252_897052_20698892 X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The content of the platform_data of a struct mfd_cell is simply passed on to the platform_device_add_data() call in mfd_add_device() . platform_device_add_data() already handles the data behind that pointer as const, so there is no reason to not extend this to struct mfd_cell. This allows to pass structs gathered from of_device_get_match_data() as platform-data to sub-devices - which is retrieved as const already. Signed-off-by: Heiko Stuebner --- include/linux/mfd/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index e8bcad641d8c..faeea7abd688 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -72,7 +72,7 @@ struct mfd_cell { int (*resume)(struct platform_device *dev); /* platform data passed to the sub devices drivers */ - void *platform_data; + const void *platform_data; size_t pdata_size; /* Matches ACPI */