Skip to content

Commit b4fd4ae

Browse files
committed
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM / Domains: Fix build for CONFIG_PM_RUNTIME unset
2 parents aa462ab + 17f2ae7 commit b4fd4ae

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

drivers/base/power/domain.c

+15-15
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,21 @@ static int pm_genpd_runtime_resume(struct device *dev)
460460
return 0;
461461
}
462462

463+
/**
464+
* pm_genpd_poweroff_unused - Power off all PM domains with no devices in use.
465+
*/
466+
void pm_genpd_poweroff_unused(void)
467+
{
468+
struct generic_pm_domain *genpd;
469+
470+
mutex_lock(&gpd_list_lock);
471+
472+
list_for_each_entry(genpd, &gpd_list, gpd_list_node)
473+
genpd_queue_power_off_work(genpd);
474+
475+
mutex_unlock(&gpd_list_lock);
476+
}
477+
463478
#else
464479

465480
static inline void genpd_power_off_work_fn(struct work_struct *work) {}
@@ -1255,18 +1270,3 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
12551270
list_add(&genpd->gpd_list_node, &gpd_list);
12561271
mutex_unlock(&gpd_list_lock);
12571272
}
1258-
1259-
/**
1260-
* pm_genpd_poweroff_unused - Power off all PM domains with no devices in use.
1261-
*/
1262-
void pm_genpd_poweroff_unused(void)
1263-
{
1264-
struct generic_pm_domain *genpd;
1265-
1266-
mutex_lock(&gpd_list_lock);
1267-
1268-
list_for_each_entry(genpd, &gpd_list, gpd_list_node)
1269-
genpd_queue_power_off_work(genpd);
1270-
1271-
mutex_unlock(&gpd_list_lock);
1272-
}

include/linux/pm_domain.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
7272
extern void pm_genpd_init(struct generic_pm_domain *genpd,
7373
struct dev_power_governor *gov, bool is_off);
7474
extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
75-
extern void pm_genpd_poweroff_unused(void);
76-
extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
7775
#else
7876
static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
7977
struct device *dev)
@@ -101,8 +99,14 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
10199
{
102100
return -ENOSYS;
103101
}
104-
static inline void pm_genpd_poweroff_unused(void) {}
102+
#endif
103+
104+
#ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
105+
extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
106+
extern void pm_genpd_poweroff_unused(void);
107+
#else
105108
static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
109+
static inline void pm_genpd_poweroff_unused(void) {}
106110
#endif
107111

108112
#endif /* _LINUX_PM_DOMAIN_H */

kernel/power/Kconfig

+4
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,7 @@ config PM_CLK
231231
config PM_GENERIC_DOMAINS
232232
bool
233233
depends on PM
234+
235+
config PM_GENERIC_DOMAINS_RUNTIME
236+
def_bool y
237+
depends on PM_RUNTIME && PM_GENERIC_DOMAINS

0 commit comments

Comments
 (0)