Re: [PATCH v4 3/4] OPP: Add support of "opp-microwatt" for advanced EM registration

From: Viresh Kumar
Date: Wed Mar 02 2022 - 02:45:26 EST


On 01-03-22, 09:35, Lukasz Luba wrote:
> /**
> * dev_pm_opp_of_register_em() - Attempt to register an Energy Model
> * @dev : Device for which an Energy Model has to be registered
> @@ -1517,6 +1567,12 @@ int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus)
> goto failed;
> }
>
> + /* First, try to find more precised Energy Model in DT */
> + if (_of_has_opp_microwatt_property(dev)) {
> + em_cb.active_power = _get_dt_power;

You can also do (to fix the warning) this instead:

em_cb = EM_DATA_CB(_get_dt_power);

Similar for the else part.

> + goto register_em;
> + }
> +
> np = of_node_get(dev->of_node);
> if (!np) {
> ret = -EINVAL;
> @@ -1538,6 +1594,7 @@ int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus)
> goto failed;
> }
>
> +register_em:
> ret = em_dev_register_perf_domain(dev, nr_opp, &em_cb, cpus, true);
> if (ret)
> goto failed;
> --
> 2.17.1

--
viresh