From mboxrd@z Thu Jan 1 00:00:00 1970 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 2DD74C3ABBC for ; Tue, 6 May 2025 04:51:23 +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=1Z39JKC402T8GXFWtwoBFn458ONFukb+6AXj0rpSNOs=; b=jXsHvuRNNJy3xzDo44JSfoFSg3 hw5LGpwzTP5zD1iKfwz6z/eB8Kzm3ZITdRkG2FGOfmQmODbJ444c43M6mmRU565amT0EUQRMBebHG xctcKTKaJ0AsXBy7hhtlByu3ukPuu7jrgbccYhvWPvPPS4f9zAPvkOVy+l5G9KrA2VvYtN4Q2a7IJ jApZw923XUocYNZg2perOngjHykzBU5KTVuIv0OKg1jkTj/eqzHLD0AG2lQPNZLQze9oZCnVr6UWV 6/SQ6/15OF9Pbx2T7M+CMR+eIUJTuUkSpUyPym1j/Tx2AN2OP+5WAk9x+LIu83JAzNh0pMP1lzxdh Y382Ns9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uCAGt-0000000AIe8-1tIS; Tue, 06 May 2025 04:51:11 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uC56g-000000091DW-1XEs for linux-arm-kernel@lists.infradead.org; Mon, 05 May 2025 23:20:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 08835A4D3EC; Mon, 5 May 2025 23:14:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A3A0C4CEF1; Mon, 5 May 2025 23:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746487217; bh=T7rxqXKs/IlxOsZcDkO0kdWR2/NNTe6ktqXrjmvDgxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ms6jFVbODqEdyOBBpeM+8leimCOhL3aGw0yANYXmJx4qjbu5mtkjlNjFTCa4Aim68 DsGJWyEr4NQURUWBv1hYr6Ocuhazubl5payCWrOdfwa8g/91Zbkq314KaAUaNe6S78 U0jVLtHyFwJllQlmZlt84sK7OlUEgSF6KJUdEnhg6E7s/f6i1iLo21TUKX2evQ/lU5 tDDWHktNznZ/a2CXBDaYSmSpYAlx0w1K9NDhAH8pNrSxhRAZycfPr8BhAvn1p7Mn8c SZPOLBTfKApsUQWzsXNrHxy0DWLhv2FUEoi7ACYaYOlqvXCKh7I88YBCfwxP/C+/eT Gxeo89Mdcgbvg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrew Davis , Nishanth Menon , Sasha Levin , linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 063/114] soc: ti: k3-socinfo: Do not use syscon helper to build regmap Date: Mon, 5 May 2025 19:17:26 -0400 Message-Id: <20250505231817.2697367-63-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250505231817.2697367-1-sashal@kernel.org> References: <20250505231817.2697367-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.237 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250505_162018_494349_16EE9B8D X-CRM114-Status: GOOD ( 16.09 ) 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 From: Andrew Davis [ Upstream commit a5caf03188e44388e8c618dcbe5fffad1a249385 ] The syscon helper device_node_to_regmap() is used to fetch a regmap registered to a device node. It also currently creates this regmap if the node did not already have a regmap associated with it. This should only be used on "syscon" nodes. This driver is not such a device and instead uses device_node_to_regmap() on its own node as a hacky way to create a regmap for itself. This will not work going forward and so we should create our regmap the normal way by defining our regmap_config, fetching our memory resource, then using the normal regmap_init_mmio() function. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20250123181726.597144-1-afd@ti.com Signed-off-by: Nishanth Menon Signed-off-by: Sasha Levin --- drivers/soc/ti/k3-socinfo.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index bbbc2d2b70918..4d89481654872 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -57,6 +57,12 @@ k3_chipinfo_partno_to_names(unsigned int partno, return -EINVAL; } +static const struct regmap_config k3_chipinfo_regmap_cfg = { + .reg_bits = 32, + .val_bits = 32, + .reg_stride = 4, +}; + static int k3_chipinfo_probe(struct platform_device *pdev) { struct device_node *node = pdev->dev.of_node; @@ -64,13 +70,18 @@ static int k3_chipinfo_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct soc_device *soc_dev; struct regmap *regmap; + void __iomem *base; u32 partno_id; u32 variant; u32 jtag_id; u32 mfg; int ret; - regmap = device_node_to_regmap(node); + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + regmap = regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg); if (IS_ERR(regmap)) return PTR_ERR(regmap); -- 2.39.5