mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
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 <krzysztof.kozlowski@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20240826-phy-of-node-scope-v1-7-5b4d82582644@linaro.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
77df35acd1
commit
608863e1e6
|
|
@ -725,7 +725,6 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct qcom_qmp *qmp;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *child;
|
||||
struct phy_provider *phy_provider;
|
||||
void __iomem *serdes;
|
||||
const struct qmp_phy_cfg *cfg = NULL;
|
||||
|
|
@ -773,13 +772,13 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
|
||||
id = 0;
|
||||
for_each_available_child_of_node(dev->of_node, child) {
|
||||
for_each_available_child_of_node_scoped(dev->of_node, child) {
|
||||
/* Create per-lane phy */
|
||||
ret = qmp_pcie_msm8996_create(dev, child, id, serdes, cfg);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to create lane%d phy, %d\n",
|
||||
id, ret);
|
||||
goto err_node_put;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -790,7 +789,7 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)
|
|||
if (ret) {
|
||||
dev_err(qmp->dev,
|
||||
"failed to register pipe clock source\n");
|
||||
goto err_node_put;
|
||||
return ret;
|
||||
}
|
||||
|
||||
id++;
|
||||
|
|
@ -799,10 +798,6 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)
|
|||
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
|
||||
|
||||
return PTR_ERR_OR_ZERO(phy_provider);
|
||||
|
||||
err_node_put:
|
||||
of_node_put(child);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver qmp_pcie_msm8996_driver = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user