From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Linux PM list <linux-pm@vger.kernel.org>
Cc: "Greg Kroah-Hartman" <gregkh@suse.de>,
LKML <linux-kernel@vger.kernel.org>,
Russell King <linux@arm.linux.org.uk>
Subject: [PATCH 4/4] PM / Sleep: Remove forward-only callbacks from AMBA bus type
Date: Sat, 10 Dec 2011 00:23:37 +0100 [thread overview]
Message-ID: <201112100023.37684.rjw@sisk.pl> (raw)
In-Reply-To: <201112100018.38536.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
The forward-only PM callbacks provided by the AMBA bus type are not
necessary any more, because the PM core executes driver callbacks
when the corresponding subsystem callbacks are not present, so drop
them.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/amba/bus.c | 136 -----------------------------------------------------
1 file changed, 1 insertion(+), 135 deletions(-)
Index: linux/drivers/amba/bus.c
===================================================================
--- linux.orig/drivers/amba/bus.c
+++ linux/drivers/amba/bus.c
@@ -109,31 +109,7 @@ static int amba_legacy_resume(struct dev
return ret;
}
-static int amba_pm_prepare(struct device *dev)
-{
- struct device_driver *drv = dev->driver;
- int ret = 0;
-
- if (drv && drv->pm && drv->pm->prepare)
- ret = drv->pm->prepare(dev);
-
- return ret;
-}
-
-static void amba_pm_complete(struct device *dev)
-{
- struct device_driver *drv = dev->driver;
-
- if (drv && drv->pm && drv->pm->complete)
- drv->pm->complete(dev);
-}
-
-#else /* !CONFIG_PM_SLEEP */
-
-#define amba_pm_prepare NULL
-#define amba_pm_complete NULL
-
-#endif /* !CONFIG_PM_SLEEP */
+#endif /* CONFIG_PM_SLEEP */
#ifdef CONFIG_SUSPEND
@@ -155,22 +131,6 @@ static int amba_pm_suspend(struct device
return ret;
}
-static int amba_pm_suspend_noirq(struct device *dev)
-{
- struct device_driver *drv = dev->driver;
- int ret = 0;
-
- if (!drv)
- return 0;
-
- if (drv->pm) {
- if (drv->pm->suspend_noirq)
- ret = drv->pm->suspend_noirq(dev);
- }
-
- return ret;
-}
-
static int amba_pm_resume(struct device *dev)
{
struct device_driver *drv = dev->driver;
@@ -189,28 +149,10 @@ static int amba_pm_resume(struct device
return ret;
}
-static int amba_pm_resume_noirq(struct device *dev)
-{
- struct device_driver *drv = dev->driver;
- int ret = 0;
-
- if (!drv)
- return 0;
-
- if (drv->pm) {
- if (drv->pm->resume_noirq)
- ret = drv->pm->resume_noirq(dev);
- }
-
- return ret;
-}
-
#else /* !CONFIG_SUSPEND */
#define amba_pm_suspend NULL
#define amba_pm_resume NULL
-#define amba_pm_suspend_noirq NULL
-#define amba_pm_resume_noirq NULL
#endif /* !CONFIG_SUSPEND */
@@ -234,22 +176,6 @@ static int amba_pm_freeze(struct device
return ret;
}
-static int amba_pm_freeze_noirq(struct device *dev)
-{
- struct device_driver *drv = dev->driver;
- int ret = 0;
-
- if (!drv)
- return 0;
-
- if (drv->pm) {
- if (drv->pm->freeze_noirq)
- ret = drv->pm->freeze_noirq(dev);
- }
-
- return ret;
-}
-
static int amba_pm_thaw(struct device *dev)
{
struct device_driver *drv = dev->driver;
@@ -268,22 +194,6 @@ static int amba_pm_thaw(struct device *d
return ret;
}
-static int amba_pm_thaw_noirq(struct device *dev)
-{
- struct device_driver *drv = dev->driver;
- int ret = 0;
-
- if (!drv)
- return 0;
-
- if (drv->pm) {
- if (drv->pm->thaw_noirq)
- ret = drv->pm->thaw_noirq(dev);
- }
-
- return ret;
-}
-
static int amba_pm_poweroff(struct device *dev)
{
struct device_driver *drv = dev->driver;
@@ -302,22 +212,6 @@ static int amba_pm_poweroff(struct devic
return ret;
}
-static int amba_pm_poweroff_noirq(struct device *dev)
-{
- struct device_driver *drv = dev->driver;
- int ret = 0;
-
- if (!drv)
- return 0;
-
- if (drv->pm) {
- if (drv->pm->poweroff_noirq)
- ret = drv->pm->poweroff_noirq(dev);
- }
-
- return ret;
-}
-
static int amba_pm_restore(struct device *dev)
{
struct device_driver *drv = dev->driver;
@@ -336,32 +230,12 @@ static int amba_pm_restore(struct device
return ret;
}
-static int amba_pm_restore_noirq(struct device *dev)
-{
- struct device_driver *drv = dev->driver;
- int ret = 0;
-
- if (!drv)
- return 0;
-
- if (drv->pm) {
- if (drv->pm->restore_noirq)
- ret = drv->pm->restore_noirq(dev);
- }
-
- return ret;
-}
-
#else /* !CONFIG_HIBERNATE_CALLBACKS */
#define amba_pm_freeze NULL
#define amba_pm_thaw NULL
#define amba_pm_poweroff NULL
#define amba_pm_restore NULL
-#define amba_pm_freeze_noirq NULL
-#define amba_pm_thaw_noirq NULL
-#define amba_pm_poweroff_noirq NULL
-#define amba_pm_restore_noirq NULL
#endif /* !CONFIG_HIBERNATE_CALLBACKS */
@@ -402,20 +276,12 @@ static int amba_pm_runtime_resume(struct
#ifdef CONFIG_PM
static const struct dev_pm_ops amba_pm = {
- .prepare = amba_pm_prepare,
- .complete = amba_pm_complete,
.suspend = amba_pm_suspend,
.resume = amba_pm_resume,
.freeze = amba_pm_freeze,
.thaw = amba_pm_thaw,
.poweroff = amba_pm_poweroff,
.restore = amba_pm_restore,
- .suspend_noirq = amba_pm_suspend_noirq,
- .resume_noirq = amba_pm_resume_noirq,
- .freeze_noirq = amba_pm_freeze_noirq,
- .thaw_noirq = amba_pm_thaw_noirq,
- .poweroff_noirq = amba_pm_poweroff_noirq,
- .restore_noirq = amba_pm_restore_noirq,
SET_RUNTIME_PM_OPS(
amba_pm_runtime_suspend,
amba_pm_runtime_resume,
next prev parent reply other threads:[~2011-12-09 23:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-09 23:18 [PATCH 0/4] PM: Make the PM core execute driver callbacks if subsystem ones are not present Rafael J. Wysocki
2011-12-09 23:20 ` [PATCH 1/4] PM / Sleep: Make pm_op() and pm_noirq_op() return callback pointers Rafael J. Wysocki
2011-12-12 4:04 ` Namhyung Kim
2011-12-12 23:53 ` Rafael J. Wysocki
2011-12-13 13:55 ` Namhyung Kim
2011-12-09 23:20 ` [PATCH 2/4] PM: Run the driver callback directly if the subsystem one is not there Rafael J. Wysocki
2011-12-10 14:59 ` Alan Stern
2011-12-10 18:21 ` Rafael J. Wysocki
2011-12-09 23:21 ` [PATCH 3/4] PM / Sleep: Remove forward-only callbacks from platform bus type Rafael J. Wysocki
2011-12-09 23:23 ` Rafael J. Wysocki [this message]
2011-12-09 23:47 ` [PATCH 0/4] PM: Make the PM core execute driver callbacks if subsystem ones are not present Greg KH
2011-12-09 23:52 ` Rafael J. Wysocki
2011-12-15 22:34 ` [Update][PATCH 0/5] " Rafael J. Wysocki
2011-12-15 22:35 ` [Update][PATCH 1/5] PM / Sleep: Make pm_op() and pm_noirq_op() return callback pointers Rafael J. Wysocki
2011-12-15 22:36 ` [Update][PATCH 2/5] PM: Run the driver callback directly if the subsystem one is not there Rafael J. Wysocki
2011-12-15 22:37 ` [Update][PATCH 3/5] PM / Sleep: Remove forward-only callbacks from platform bus type Rafael J. Wysocki
2011-12-15 22:38 ` [Update][PATCH 4/5] PM / Sleep: Remove forward-only callbacks from AMBA " Rafael J. Wysocki
2011-12-15 22:39 ` [Update][PATCH 5/5] PM: Drop generic_subsys_pm_ops Rafael J. Wysocki
2011-12-15 22:47 ` Rafael J. Wysocki
2011-12-15 23:08 ` [Update][PATCH 0/5] PM: Make the PM core execute driver callbacks if subsystem ones are not present Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201112100023.37684.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.