PM: domains: Allocate gpd_timing_data dynamically based on governor
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 11 May 2022 14:56:56 +0000 (16:56 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 19 May 2022 18:16:05 +0000 (20:16 +0200)
commit66d29d802ef3bf55a49b07568b0048823d4a72a6
treedbb98432a075ea0a5324858899af407915c884ca
parentbcc19f69f72ab7e3db581b993d6a9fc1bad5ddf4
PM: domains: Allocate gpd_timing_data dynamically based on governor

If a genpd doesn't have an associated governor assigned, there's really no
point to allocate the per device gpd_timing_data, as the data isn't being
used by a governor anyway.

To avoid wasting memory, let's therefore convert the corresponding td
variable in the struct generic_pm_domain_data into a pointer and manage the
allocation of its data dynamically.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/domain.c
drivers/base/power/domain_governor.c
include/linux/pm_domain.h