• Viresh Kumar's avatar
    opp: Allocate genpd_virt_devs from dev_pm_opp_attach_genpd() · c0ab9e08
    Viresh Kumar authored
    Currently the space for the array of virtual devices is allocated along
    with the OPP table, but that isn't going to work well from now onwards.
    For single power domain case, a driver can either use the original
    device structure for setting the performance state (if genpd attached
    with dev_pm_domain_attach()) or use the virtual device structure (if
    genpd attached with dev_pm_domain_attach_by_name(), which returns the
    virtual device) and so we can't know in advance if we are going to need
    genpd_virt_devs array or not.
    
    Lets delay the allocation a bit and do it along with
    dev_pm_opp_attach_genpd() rather. The deallocation is done from
    dev_pm_opp_detach_genpd().
    Tested-by: default avatarNiklas Cassel <niklas.cassel@linaro.org>
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    c0ab9e08
core.c 56.5 KB