Skip to content

Commit 608863e

Browse files
krzkvinodkoul
authored andcommitted
phy: qcom: qmp-pcie-msm8996: Simplify with scoped for each OF child loop
Use scoped for_each_available_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 77df35a commit 608863e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,6 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)
725725
{
726726
struct qcom_qmp *qmp;
727727
struct device *dev = &pdev->dev;
728-
struct device_node *child;
729728
struct phy_provider *phy_provider;
730729
void __iomem *serdes;
731730
const struct qmp_phy_cfg *cfg = NULL;
@@ -773,13 +772,13 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)
773772
return -ENOMEM;
774773

775774
id = 0;
776-
for_each_available_child_of_node(dev->of_node, child) {
775+
for_each_available_child_of_node_scoped(dev->of_node, child) {
777776
/* Create per-lane phy */
778777
ret = qmp_pcie_msm8996_create(dev, child, id, serdes, cfg);
779778
if (ret) {
780779
dev_err(dev, "failed to create lane%d phy, %d\n",
781780
id, ret);
782-
goto err_node_put;
781+
return ret;
783782
}
784783

785784
/*
@@ -790,7 +789,7 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)
790789
if (ret) {
791790
dev_err(qmp->dev,
792791
"failed to register pipe clock source\n");
793-
goto err_node_put;
792+
return ret;
794793
}
795794

796795
id++;
@@ -799,10 +798,6 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)
799798
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
800799

801800
return PTR_ERR_OR_ZERO(phy_provider);
802-
803-
err_node_put:
804-
of_node_put(child);
805-
return ret;
806801
}
807802

808803
static struct platform_driver qmp_pcie_msm8996_driver = {

0 commit comments

Comments
 (0)