From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Andrew Davis <afd@ti.com>, Nishanth Menon <nm@ti.com>,
Vinod Koul <vkoul@kernel.org>, Sasha Levin <sashal@kernel.org>,
kishon@kernel.org, krzysztof.kozlowski@linaro.org,
rogerq@kernel.org, s-vadapalli@ti.com,
linux-phy@lists.infradead.org
Subject: [PATCH AUTOSEL 6.12 01/17] phy: ti: gmii-sel: Do not use syscon helper to build regmap
Date: Mon, 3 Mar 2025 11:30:13 -0500 [thread overview]
Message-ID: <20250303163031.3763651-1-sashal@kernel.org> (raw)
From: Andrew Davis <afd@ti.com>
[ Upstream commit 5ab90f40121a9f6a9b368274cd92d0f435dc7cfa ]
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 <afd@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20250123182234.597665-1-afd@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/ti/phy-gmii-sel.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c
index 103b266fec771..2c2256fe5a3b6 100644
--- a/drivers/phy/ti/phy-gmii-sel.c
+++ b/drivers/phy/ti/phy-gmii-sel.c
@@ -423,6 +423,12 @@ static int phy_gmii_sel_init_ports(struct phy_gmii_sel_priv *priv)
return 0;
}
+static const struct regmap_config phy_gmii_sel_regmap_cfg = {
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+};
+
static int phy_gmii_sel_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -467,7 +473,14 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
priv->regmap = syscon_node_to_regmap(node->parent);
if (IS_ERR(priv->regmap)) {
- priv->regmap = device_node_to_regmap(node);
+ void __iomem *base;
+
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return dev_err_probe(dev, PTR_ERR(base),
+ "failed to get base memory resource\n");
+
+ priv->regmap = regmap_init_mmio(dev, base, &phy_gmii_sel_regmap_cfg);
if (IS_ERR(priv->regmap))
return dev_err_probe(dev, PTR_ERR(priv->regmap),
"Failed to get syscon\n");
--
2.39.5
next reply other threads:[~2025-03-03 16:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 16:30 Sasha Levin [this message]
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 02/17] ASoC: tas2770: Fix volume scale Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 03/17] ASoC: tas2764: Fix power control mask Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 04/17] ASoC: tas2764: Set the SDOUT polarity correctly Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 05/17] fuse: don't truncate cached, mutated symlink Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 06/17] ASoC: dapm-graph: set fill colour of turned on nodes Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 07/17] ASoC: SOF: Intel: don't check number of sdw links when set dmic_fixup Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 08/17] drm/vkms: Round fixp2int conversion in lerp_u16 Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 09/17] perf/x86/intel: Use better start period for frequency mode Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 10/17] x86/of: Don't use DTB for SMP setup if ACPI is enabled Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 11/17] x86/irq: Define trace events conditionally Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 12/17] perf/x86/rapl: Add support for Intel Arrow Lake U Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 13/17] mptcp: safety check before fallback Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 14/17] drm/nouveau: Do not override forced connector status Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 15/17] net: Handle napi_schedule() calls from non-interrupt Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 16/17] block: fix 'kmem_cache of name 'bio-108' already exists' Sasha Levin
2025-03-03 16:30 ` [PATCH AUTOSEL 6.12 17/17] vhost: return task creation error instead of NULL Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250303163031.3763651-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=afd@ti.com \
--cc=kishon@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=nm@ti.com \
--cc=rogerq@kernel.org \
--cc=s-vadapalli@ti.com \
--cc=stable@vger.kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox