Commit c4c349be authored by Liang He's avatar Liang He Committed by Vinod Koul

phy: amlogic: phy-meson-axg-mipi-pcie-analog: Hold reference returned by of_get_parent()

As the of_get_parent() will increase the refcount of the node->parent
and the reference will be discarded, so we should hold the reference
with which we can decrease the refcount when done.

Fixes: 8eff8b4e ("phy: amlogic: phy-meson-axg-mipi-pcie-analog: add support for MIPI DSI analog")
Signed-off-by: default avatarLiang He <windhl@126.com>

Link: https://lore.kernel.org/r/20220915093506.4009456-1-windhl@126.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 92086b88
...@@ -197,7 +197,7 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev) ...@@ -197,7 +197,7 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev)
struct phy_provider *phy; struct phy_provider *phy;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct phy_axg_mipi_pcie_analog_priv *priv; struct phy_axg_mipi_pcie_analog_priv *priv;
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node, *parent_np;
struct regmap *map; struct regmap *map;
int ret; int ret;
...@@ -206,7 +206,9 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev) ...@@ -206,7 +206,9 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
/* Get the hhi system controller node */ /* Get the hhi system controller node */
map = syscon_node_to_regmap(of_get_parent(dev->of_node)); parent_np = of_get_parent(dev->of_node);
map = syscon_node_to_regmap(parent_np);
of_node_put(parent_np);
if (IS_ERR(map)) { if (IS_ERR(map)) {
dev_err(dev, dev_err(dev,
"failed to get HHI regmap\n"); "failed to get HHI regmap\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment