From: Anand Moon <linux.amoon@gmail.com>
To: Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-phy@lists.infradead.org (open list:GENERIC PHY FRAMEWORK),
linux-arm-kernel@lists.infradead.org (moderated list:ARM/Amlogic
Meson SoC support),
linux-amlogic@lists.infradead.org (open list:ARM/Amlogic Meson
SoC support), linux-kernel@vger.kernel.org (open list)
Cc: Anand Moon <linux.amoon@gmail.com>
Subject: [PATCH v1 6/6] phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe
Date: Thu, 10 Apr 2025 19:03:21 +0530 [thread overview]
Message-ID: <20250410133332.294556-7-linux.amoon@gmail.com> (raw)
In-Reply-To: <20250410133332.294556-1-linux.amoon@gmail.com>
Reorder the PHY creation in the axg-pcie probe function to ensure all
the resource is mapped before creating the PHY. This change addresses
the issue where the PHY creation was attempted before
mapping the necessary resources, potentially causing failures.
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
drivers/phy/amlogic/phy-meson-axg-pcie.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/amlogic/phy-meson-axg-pcie.c b/drivers/phy/amlogic/phy-meson-axg-pcie.c
index 54baf7b8930e1..14dee73f9cb57 100644
--- a/drivers/phy/amlogic/phy-meson-axg-pcie.c
+++ b/drivers/phy/amlogic/phy-meson-axg-pcie.c
@@ -136,11 +136,6 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
- if (IS_ERR(priv->phy))
- return dev_err_probe(dev, PTR_ERR(priv->phy),
- "failed to create PHY\n");
-
base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base))
return PTR_ERR(base);
@@ -158,6 +153,11 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
if (IS_ERR(priv->analog))
return PTR_ERR(priv->analog);
+ priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
+ if (IS_ERR(priv->phy))
+ return dev_err_probe(dev, PTR_ERR(priv->phy),
+ "failed to create PHY\n");
+
phy_set_drvdata(priv->phy, priv);
dev_set_drvdata(dev, priv);
pphy = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
--
2.49.0
next prev parent reply other threads:[~2025-04-10 13:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 13:33 [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Anand Moon
2025-04-10 13:33 ` [PATCH v1 1/6] phy: amlogic: phy-meson-gxl-usb2: " Anand Moon
2025-04-11 8:32 ` Neil Armstrong
2025-04-10 13:33 ` [PATCH v1 2/6] phy: amlogic: phy-meson-g12a-usb2: " Anand Moon
2025-04-11 8:32 ` Neil Armstrong
2025-04-10 13:33 ` [PATCH v1 3/6] phy: amlogic: phy-meson-axg-mipi-pcie-analog: " Anand Moon
2025-04-11 8:32 ` Neil Armstrong
2025-04-10 13:33 ` [PATCH v1 4/6] phy: amlogic: phy-meson-axg-mipi-dphy: " Anand Moon
2025-04-11 8:32 ` Neil Armstrong
2025-04-10 13:33 ` [PATCH v1 5/6] phy: amlogic: phy-meson-axg-pcie: " Anand Moon
2025-04-11 8:32 ` Neil Armstrong
2025-04-10 13:33 ` Anand Moon [this message]
2025-04-11 8:33 ` [PATCH v1 6/6] phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe Neil Armstrong
2025-04-11 12:11 ` [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Vinod Koul
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=20250410133332.294556-7-linux.amoon@gmail.com \
--to=linux.amoon@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=kishon@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.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;
as well as URLs for NNTP newsgroup(s).