Re: [PATCH 07/11] pmdomain: core: Export a common ->sync_state() helper for genpd providers

Dan Carpenter
2025-05-07T16:23:48Z

On Thu, Apr 17, 2025 at 04:25:05PM +0200, Ulf Hansson wrote:
> +void of_genpd_sync_state(struct device *dev)
> +{
> + struct device_node *np = dev->of_node;
> + struct generic_pm_domain *genpd;
> +
> + if (!np)
> + return;
> +
> + mutex_lock(&gpd_list_lock);
> + list_for_each_entry(genpd, &gpd_list, gpd_list_node) {
> + if (genpd->provider == &np->fwnode) {

Presumably this would be "== of_fwnode_handle(np)) {" as well...

regards,
dan carpenter

> + genpd_lock(genpd);
> + genpd_power_off(genpd, false, 0);
> + genpd_unlock(genpd);
> + }
> + }
> + mutex_unlock(&gpd_list_lock);
> +}