Re: [PATCH v17 06/12] soc: mediatek: Add support for hierarchical scpsys device node

From: Nicolas Boichat
Date: Mon Sep 28 2020 - 03:15:11 EST


On Thu, Aug 6, 2020 at 5:22 PM Weiyi Lu <weiyi.lu@xxxxxxxxxxxx> wrote:
>
> Try to list all the power domains of under power controller
> node to show the dependency between each power domain directly
> instead of filling the dependency in scp_soc_data.
> And could be more clearly to group subsys clocks into power domain
> sub node to introduce subsys clocks of bus protection in next patch.
>
> Signed-off-by: Weiyi Lu <weiyi.lu@xxxxxxxxxxxx>
> ---
[snip]
> +static int traverse_scp(struct platform_device *pdev, struct scp *scp,
> + const struct scp_domain_data *scp_domain_data)
> +{
> + struct device *dev = &pdev->dev;
> + struct device_node *np = dev->of_node;
> + struct device_node *sub;
> + int ret;
> +
> + INIT_LIST_HEAD(&scp->dep_links);
> +
> + for_each_available_child_of_node(np, sub) {
> + ret = scpsys_get_domain(pdev, scp, sub, scp_domain_data);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to handle node %pOFn: %d\n", sub, ret);

minor comment: this error should not be printed if ret ==
-EPROBE_DEFER (use the new dev_err_probe?)

> + goto err;
> + }
> + }
> +
> + return 0;
> +
> +err:
> + of_node_put(sub);
> + return ret;
> +}
[snip]