All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM / core: Drop legacy class suspend/resume operations
@ 2017-09-25 12:56 Rafael J. Wysocki
  2017-09-25 13:24 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2017-09-25 12:56 UTC (permalink / raw)
  To: Linux PM; +Cc: Alan Stern, Greg Kroah-Hartman, LKML

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

There are no classes using the legacy suspend/resume operations in
the tree any more, so drop these operations and update the code
referring to them accordingly.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/base/power/main.c |   32 +++++++++-----------------------
 include/linux/device.h    |    5 -----
 2 files changed, 9 insertions(+), 28 deletions(-)

Index: linux-pm/include/linux/device.h
===================================================================
--- linux-pm.orig/include/linux/device.h
+++ linux-pm/include/linux/device.h
@@ -372,9 +372,6 @@ int subsys_virtual_register(struct bus_t
  * @devnode:	Callback to provide the devtmpfs.
  * @class_release: Called to release this class.
  * @dev_release: Called to release the device.
- * @suspend:	Used to put the device to sleep mode, usually to a low power
- *		state.
- * @resume:	Used to bring the device from the sleep mode.
  * @shutdown_pre: Called at shut-down time before driver shutdown.
  * @ns_type:	Callbacks so sysfs can detemine namespaces.
  * @namespace:	Namespace of the device belongs to this class.
@@ -402,8 +399,6 @@ struct class {
 	void (*class_release)(struct class *class);
 	void (*dev_release)(struct device *dev);
 
-	int (*suspend)(struct device *dev, pm_message_t state);
-	int (*resume)(struct device *dev);
 	int (*shutdown_pre)(struct device *dev);
 
 	const struct kobj_ns_type_operations *ns_type;
Index: linux-pm/drivers/base/power/main.c
===================================================================
--- linux-pm.orig/drivers/base/power/main.c
+++ linux-pm/drivers/base/power/main.c
@@ -848,16 +848,10 @@ static int device_resume(struct device *
 		goto Driver;
 	}
 
-	if (dev->class) {
-		if (dev->class->pm) {
-			info = "class ";
-			callback = pm_op(dev->class->pm, state);
-			goto Driver;
-		} else if (dev->class->resume) {
-			info = "legacy class ";
-			callback = dev->class->resume;
-			goto End;
-		}
+	if (dev->class && dev->class->pm) {
+		info = "class ";
+		callback = pm_op(dev->class->pm, state);
+		goto Driver;
 	}
 
 	if (dev->bus) {
@@ -1508,17 +1502,10 @@ static int __device_suspend(struct devic
 		goto Run;
 	}
 
-	if (dev->class) {
-		if (dev->class->pm) {
-			info = "class ";
-			callback = pm_op(dev->class->pm, state);
-			goto Run;
-		} else if (dev->class->suspend) {
-			pm_dev_dbg(dev, state, "legacy class ");
-			error = legacy_suspend(dev, state, dev->class->suspend,
-						"legacy class ");
-			goto End;
-		}
+	if (dev->class && dev->class->pm) {
+		info = "class ";
+		callback = pm_op(dev->class->pm, state);
+		goto Run;
 	}
 
 	if (dev->bus) {
@@ -1862,8 +1849,7 @@ void device_pm_check_callbacks(struct de
 	dev->power.no_pm_callbacks =
 		(!dev->bus || (pm_ops_is_empty(dev->bus->pm) &&
 		 !dev->bus->suspend && !dev->bus->resume)) &&
-		(!dev->class || (pm_ops_is_empty(dev->class->pm) &&
-		 !dev->class->suspend && !dev->class->resume)) &&
+		(!dev->class || pm_ops_is_empty(dev->class->pm)) &&
 		(!dev->type || pm_ops_is_empty(dev->type->pm)) &&
 		(!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) &&
 		(!dev->driver || (pm_ops_is_empty(dev->driver->pm) &&

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM / core: Drop legacy class suspend/resume operations
  2017-09-25 12:56 [PATCH] PM / core: Drop legacy class suspend/resume operations Rafael J. Wysocki
@ 2017-09-25 13:24 ` Greg Kroah-Hartman
  2017-09-25 15:17   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-25 13:24 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Linux PM, Alan Stern, LKML

On Mon, Sep 25, 2017 at 02:56:44PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> There are no classes using the legacy suspend/resume operations in
> the tree any more, so drop these operations and update the code
> referring to them accordingly.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/base/power/main.c |   32 +++++++++-----------------------
>  include/linux/device.h    |    5 -----
>  2 files changed, 9 insertions(+), 28 deletions(-)

Yeah!!!

Do you want me to take this now, for -rc2, in my tree (as I'll gladly do
so, I have some other api removals queued up already), or do you want to
do it through yours?

Either is fine with me, if you want to take it:
	Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM / core: Drop legacy class suspend/resume operations
  2017-09-25 13:24 ` Greg Kroah-Hartman
@ 2017-09-25 15:17   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2017-09-25 15:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Linux PM, Alan Stern, LKML

On Monday, September 25, 2017 3:24:43 PM CEST Greg Kroah-Hartman wrote:
> On Mon, Sep 25, 2017 at 02:56:44PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > There are no classes using the legacy suspend/resume operations in
> > the tree any more, so drop these operations and update the code
> > referring to them accordingly.
> > 
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >  drivers/base/power/main.c |   32 +++++++++-----------------------
> >  include/linux/device.h    |    5 -----
> >  2 files changed, 9 insertions(+), 28 deletions(-)
> 
> Yeah!!!
> 
> Do you want me to take this now, for -rc2, in my tree (as I'll gladly do
> so, I have some other api removals queued up already), or do you want to
> do it through yours?
> 
> Either is fine with me, if you want to take it:
> 	Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 

There likely will be more patches going in this direction from me shortly, so
I'll handle it. :-)

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-25 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-25 12:56 [PATCH] PM / core: Drop legacy class suspend/resume operations Rafael J. Wysocki
2017-09-25 13:24 ` Greg Kroah-Hartman
2017-09-25 15:17   ` Rafael J. Wysocki

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.