phy: ti: gmii-sel: Fix register offset when parent is not a syscon node
authorAndrew Davis <afd@ti.com>
Wed, 25 Oct 2023 14:33:02 +0000 (09:33 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jan 2024 16:16:56 +0000 (17:16 +0100)
commita7ccc9d9001b59a7ce56b3655386cc76885ad8fe
treef2944be0518ef7159737a1979e5312bbf90cf7ec
parent42db0099eca3bee8459b8c0121975dc8d7cc1c75
phy: ti: gmii-sel: Fix register offset when parent is not a syscon node

[ Upstream commit 0f40d5099cd6d828fd7de6227d3eabe86016724c ]

When the node for this phy selector is a child node of a syscon node then the
property 'reg' is used as an offset into the parent regmap. When the node
is standalone and gets its own regmap this offset is pre-applied. So we need
to track which method was used to get the regmap and not apply the offset
in the standalone case.

Fixes: 1fdfa7cccd35 ("phy: ti: gmii-sel: Allow parent to not be syscon node")
Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20231025143302.1265633-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