PM / Domains: Remove redundant wrapper functions for system PM

Due to the previous changes in genpd, which removed the suspend_power_off
flag, several of the system PM callbacks no longer do any additional
checks but only invoke corresponding pm_generic_* helper functions.

To clean up the code, drop these wrapper functions as they have
become redundant. Instead, assign the system PM callbacks directly
to the pm_generic_*() helper functions.

While changing this, it has bocame clear that some of the current
system PM callbacks in genpd invoke wrong driver callbacks. For
example, the genpd's ->restore() callback invokes pm_generic_resume(),
while that should be pm_generic_restore(). Fix that as well.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Ulf Hansson 2016-05-30 11:43:08 +02:00 коммит произвёл Rafael J. Wysocki
Родитель 39dd0f234f
Коммит 8001885389
1 изменённых файлов: 12 добавлений и 191 удалений

Просмотреть файл

@ -767,48 +767,6 @@ static int pm_genpd_prepare(struct device *dev)
return ret; return ret;
} }
/**
* pm_genpd_suspend - Suspend a device belonging to an I/O PM domain.
* @dev: Device to suspend.
*
* Suspend a device under the assumption that its pm_domain field points to the
* domain member of an object of type struct generic_pm_domain representing
* a PM domain consisting of I/O devices.
*/
static int pm_genpd_suspend(struct device *dev)
{
struct generic_pm_domain *genpd;
dev_dbg(dev, "%s()\n", __func__);
genpd = dev_to_genpd(dev);
if (IS_ERR(genpd))
return -EINVAL;
return pm_generic_suspend(dev);
}
/**
* pm_genpd_suspend_late - Late suspend of a device from an I/O PM domain.
* @dev: Device to suspend.
*
* Carry out a late suspend of a device under the assumption that its
* pm_domain field points to the domain member of an object of type
* struct generic_pm_domain representing a PM domain consisting of I/O devices.
*/
static int pm_genpd_suspend_late(struct device *dev)
{
struct generic_pm_domain *genpd;
dev_dbg(dev, "%s()\n", __func__);
genpd = dev_to_genpd(dev);
if (IS_ERR(genpd))
return -EINVAL;
return pm_generic_suspend_late(dev);
}
/** /**
* pm_genpd_suspend_noirq - Completion of suspend of device in an I/O PM domain. * pm_genpd_suspend_noirq - Completion of suspend of device in an I/O PM domain.
* @dev: Device to suspend. * @dev: Device to suspend.
@ -872,92 +830,6 @@ static int pm_genpd_resume_noirq(struct device *dev)
return genpd_start_dev(genpd, dev); return genpd_start_dev(genpd, dev);
} }
/**
* pm_genpd_resume_early - Early resume of a device in an I/O PM domain.
* @dev: Device to resume.
*
* Carry out an early resume of a device under the assumption that its
* pm_domain field points to the domain member of an object of type
* struct generic_pm_domain representing a power domain consisting of I/O
* devices.
*/
static int pm_genpd_resume_early(struct device *dev)
{
struct generic_pm_domain *genpd;
dev_dbg(dev, "%s()\n", __func__);
genpd = dev_to_genpd(dev);
if (IS_ERR(genpd))
return -EINVAL;
return pm_generic_resume_early(dev);
}
/**
* pm_genpd_resume - Resume of device in an I/O PM domain.
* @dev: Device to resume.
*
* Resume a device under the assumption that its pm_domain field points to the
* domain member of an object of type struct generic_pm_domain representing
* a power domain consisting of I/O devices.
*/
static int pm_genpd_resume(struct device *dev)
{
struct generic_pm_domain *genpd;
dev_dbg(dev, "%s()\n", __func__);
genpd = dev_to_genpd(dev);
if (IS_ERR(genpd))
return -EINVAL;
return pm_generic_resume(dev);
}
/**
* pm_genpd_freeze - Freezing a device in an I/O PM domain.
* @dev: Device to freeze.
*
* Freeze a device under the assumption that its pm_domain field points to the
* domain member of an object of type struct generic_pm_domain representing
* a power domain consisting of I/O devices.
*/
static int pm_genpd_freeze(struct device *dev)
{
struct generic_pm_domain *genpd;
dev_dbg(dev, "%s()\n", __func__);
genpd = dev_to_genpd(dev);
if (IS_ERR(genpd))
return -EINVAL;
return pm_generic_freeze(dev);
}
/**
* pm_genpd_freeze_late - Late freeze of a device in an I/O PM domain.
* @dev: Device to freeze.
*
* Carry out a late freeze of a device under the assumption that its
* pm_domain field points to the domain member of an object of type
* struct generic_pm_domain representing a power domain consisting of I/O
* devices.
*/
static int pm_genpd_freeze_late(struct device *dev)
{
struct generic_pm_domain *genpd;
dev_dbg(dev, "%s()\n", __func__);
genpd = dev_to_genpd(dev);
if (IS_ERR(genpd))
return -EINVAL;
return pm_generic_freeze_late(dev);
}
/** /**
* pm_genpd_freeze_noirq - Completion of freezing a device in an I/O PM domain. * pm_genpd_freeze_noirq - Completion of freezing a device in an I/O PM domain.
* @dev: Device to freeze. * @dev: Device to freeze.
@ -1000,49 +872,6 @@ static int pm_genpd_thaw_noirq(struct device *dev)
return genpd_start_dev(genpd, dev); return genpd_start_dev(genpd, dev);
} }
/**
* pm_genpd_thaw_early - Early thaw of device in an I/O PM domain.
* @dev: Device to thaw.
*
* Carry out an early thaw of a device under the assumption that its
* pm_domain field points to the domain member of an object of type
* struct generic_pm_domain representing a power domain consisting of I/O
* devices.
*/
static int pm_genpd_thaw_early(struct device *dev)
{
struct generic_pm_domain *genpd;
dev_dbg(dev, "%s()\n", __func__);
genpd = dev_to_genpd(dev);
if (IS_ERR(genpd))
return -EINVAL;
return pm_generic_thaw_early(dev);
}
/**
* pm_genpd_thaw - Thaw a device belonging to an I/O power domain.
* @dev: Device to thaw.
*
* Thaw a device under the assumption that its pm_domain field points to the
* domain member of an object of type struct generic_pm_domain representing
* a power domain consisting of I/O devices.
*/
static int pm_genpd_thaw(struct device *dev)
{
struct generic_pm_domain *genpd;
dev_dbg(dev, "%s()\n", __func__);
genpd = dev_to_genpd(dev);
if (IS_ERR(genpd))
return -EINVAL;
return pm_generic_thaw(dev);
}
/** /**
* pm_genpd_restore_noirq - Start of restore of device in an I/O PM domain. * pm_genpd_restore_noirq - Start of restore of device in an I/O PM domain.
* @dev: Device to resume. * @dev: Device to resume.
@ -1151,18 +980,10 @@ EXPORT_SYMBOL_GPL(pm_genpd_syscore_poweron);
#else /* !CONFIG_PM_SLEEP */ #else /* !CONFIG_PM_SLEEP */
#define pm_genpd_prepare NULL #define pm_genpd_prepare NULL
#define pm_genpd_suspend NULL
#define pm_genpd_suspend_late NULL
#define pm_genpd_suspend_noirq NULL #define pm_genpd_suspend_noirq NULL
#define pm_genpd_resume_early NULL
#define pm_genpd_resume_noirq NULL #define pm_genpd_resume_noirq NULL
#define pm_genpd_resume NULL
#define pm_genpd_freeze NULL
#define pm_genpd_freeze_late NULL
#define pm_genpd_freeze_noirq NULL #define pm_genpd_freeze_noirq NULL
#define pm_genpd_thaw_early NULL
#define pm_genpd_thaw_noirq NULL #define pm_genpd_thaw_noirq NULL
#define pm_genpd_thaw NULL
#define pm_genpd_restore_noirq NULL #define pm_genpd_restore_noirq NULL
#define pm_genpd_complete NULL #define pm_genpd_complete NULL
@ -1454,24 +1275,24 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
genpd->domain.ops.runtime_suspend = genpd_runtime_suspend; genpd->domain.ops.runtime_suspend = genpd_runtime_suspend;
genpd->domain.ops.runtime_resume = genpd_runtime_resume; genpd->domain.ops.runtime_resume = genpd_runtime_resume;
genpd->domain.ops.prepare = pm_genpd_prepare; genpd->domain.ops.prepare = pm_genpd_prepare;
genpd->domain.ops.suspend = pm_genpd_suspend; genpd->domain.ops.suspend = pm_generic_suspend;
genpd->domain.ops.suspend_late = pm_genpd_suspend_late; genpd->domain.ops.suspend_late = pm_generic_suspend_late;
genpd->domain.ops.suspend_noirq = pm_genpd_suspend_noirq; genpd->domain.ops.suspend_noirq = pm_genpd_suspend_noirq;
genpd->domain.ops.resume_noirq = pm_genpd_resume_noirq; genpd->domain.ops.resume_noirq = pm_genpd_resume_noirq;
genpd->domain.ops.resume_early = pm_genpd_resume_early; genpd->domain.ops.resume_early = pm_generic_resume_early;
genpd->domain.ops.resume = pm_genpd_resume; genpd->domain.ops.resume = pm_generic_resume;
genpd->domain.ops.freeze = pm_genpd_freeze; genpd->domain.ops.freeze = pm_generic_freeze;
genpd->domain.ops.freeze_late = pm_genpd_freeze_late; genpd->domain.ops.freeze_late = pm_generic_freeze_late;
genpd->domain.ops.freeze_noirq = pm_genpd_freeze_noirq; genpd->domain.ops.freeze_noirq = pm_genpd_freeze_noirq;
genpd->domain.ops.thaw_noirq = pm_genpd_thaw_noirq; genpd->domain.ops.thaw_noirq = pm_genpd_thaw_noirq;
genpd->domain.ops.thaw_early = pm_genpd_thaw_early; genpd->domain.ops.thaw_early = pm_generic_thaw_early;
genpd->domain.ops.thaw = pm_genpd_thaw; genpd->domain.ops.thaw = pm_generic_thaw;
genpd->domain.ops.poweroff = pm_genpd_suspend; genpd->domain.ops.poweroff = pm_generic_poweroff;
genpd->domain.ops.poweroff_late = pm_genpd_suspend_late; genpd->domain.ops.poweroff_late = pm_generic_poweroff_late;
genpd->domain.ops.poweroff_noirq = pm_genpd_suspend_noirq; genpd->domain.ops.poweroff_noirq = pm_genpd_suspend_noirq;
genpd->domain.ops.restore_noirq = pm_genpd_restore_noirq; genpd->domain.ops.restore_noirq = pm_genpd_restore_noirq;
genpd->domain.ops.restore_early = pm_genpd_resume_early; genpd->domain.ops.restore_early = pm_generic_restore_early;
genpd->domain.ops.restore = pm_genpd_resume; genpd->domain.ops.restore = pm_generic_restore;
genpd->domain.ops.complete = pm_genpd_complete; genpd->domain.ops.complete = pm_genpd_complete;
if (genpd->flags & GENPD_FLAG_PM_CLK) { if (genpd->flags & GENPD_FLAG_PM_CLK) {