mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 10:11:38 -04:00
pmdomain: mediatek: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
committed by
Ulf Hansson
parent
adff6abbdc
commit
ecd2f0eaff
@@ -1182,7 +1182,6 @@ static int scpsys_probe(struct platform_device *pdev)
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
const struct scpsys_soc_data *soc;
|
||||
struct device_node *node;
|
||||
struct device *parent;
|
||||
struct scpsys *scpsys;
|
||||
int num_domains, ret;
|
||||
@@ -1226,21 +1225,18 @@ static int scpsys_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
|
||||
ret = -ENODEV;
|
||||
for_each_available_child_of_node(np, node) {
|
||||
for_each_available_child_of_node_scoped(np, node) {
|
||||
struct generic_pm_domain *domain;
|
||||
|
||||
domain = scpsys_add_one_domain(scpsys, node);
|
||||
if (IS_ERR(domain)) {
|
||||
ret = PTR_ERR(domain);
|
||||
of_node_put(node);
|
||||
goto err_cleanup_domains;
|
||||
}
|
||||
|
||||
ret = scpsys_add_subdomain(scpsys, node);
|
||||
if (ret) {
|
||||
of_node_put(node);
|
||||
if (ret)
|
||||
goto err_cleanup_domains;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
|
||||
Reference in New Issue
Block a user