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: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 13792859 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 B4579CE7A89 for ; Thu, 5 Sep 2024 19:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EBMUNEsgg3HNHWKY+I4PZ0QO6FHi+iK8X6AqrZyqPbo=; b=GowzRkmBrTAVnY7UNP4m/fIRlN rBpNnmrMecSzKnEi3NOtx5HQkt/viG1drey3x+5a5Oiae9RAqsWlRKoKmkTPuTBHMT5NaUymKWB4x bdPW1xYf9E/23TqvlZDQQlxKjuSCi9OL+QmlWXYlNLprb0xqySurtT/ZJUboFSS1za82uLsA1FmKU Hk8yzNfYTha22BENKB2mNggpcyh4jsBq0/46BvNuAQ7E5XkK83IQcmiZ1IwtvEWumEsLflfbqrR+A Goli3c0OGqPNjZmoqpH7/NrGEsM7X5xhbN+tRtWSIEPCm7PN7hoP5W4z4CRt5qCFp2oqfgWEeK5D6 hNMAZi1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smHim-00000009Wso-2MyO; Thu, 05 Sep 2024 19:00:44 +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-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 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 */