Skip to content

Commit

Permalink
PM / Domains: Fix build for CONFIG_PM_SLEEP unset
Browse files Browse the repository at this point in the history
Some callback functions defined in drivers/base/power/domain.c are
only necessary if CONFIG_PM_SLEEP is set and they call some other
functions that are only available in that case.  For this reason,
they should not be compiled at all when CONFIG_PM_SLEEP is not set.

Reported-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
  • Loading branch information
Rafael J. Wysocki committed Jan 13, 2012
1 parent dae5cbc commit 0f1d698
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/base/power/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,8 @@ static int pm_genpd_default_restore_state(struct device *dev)
return 0;
}

#ifdef CONFIG_PM_SLEEP

/**
* pm_genpd_default_suspend - Default "device suspend" for PM domians.
* @dev: Device to handle.
Expand Down Expand Up @@ -1517,6 +1519,19 @@ static int pm_genpd_default_thaw(struct device *dev)
return cb ? cb(dev) : pm_generic_thaw(dev);
}

#else /* !CONFIG_PM_SLEEP */

#define pm_genpd_default_suspend NULL
#define pm_genpd_default_suspend_late NULL
#define pm_genpd_default_resume_early NULL
#define pm_genpd_default_resume NULL
#define pm_genpd_default_freeze NULL
#define pm_genpd_default_freeze_late NULL
#define pm_genpd_default_thaw_early NULL
#define pm_genpd_default_thaw NULL

#endif /* !CONFIG_PM_SLEEP */

/**
* pm_genpd_init - Initialize a generic I/O PM domain object.
* @genpd: PM domain object to initialize.
Expand Down

0 comments on commit 0f1d698

Please sign in to comment.