public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] pm: remove device_type suspend()/resume()
@ 2009-06-01 10:38 Magnus Damm
  2009-06-01 18:40 ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Magnus Damm @ 2009-06-01 10:38 UTC (permalink / raw)
  To: linux-pm; +Cc: gregkh

From: Magnus Damm <damm@igel.co.jp>

This patch removes the legacy callbacks ->suspend() and
->resume() from struct device_type. These callbacks seem
unused, and new code should instead make use of struct
dev_pm_ops.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 Only lightly compile tested on my laptop, could use some
 multi-arch build farm verification.

 drivers/base/power/main.c |    7 -------
 include/linux/device.h    |    3 ---
 2 files changed, 10 deletions(-)

--- 0001/drivers/base/power/main.c
+++ work/drivers/base/power/main.c	2009-06-01 17:07:23.000000000 +0900
@@ -399,9 +399,6 @@ static int device_resume(struct device *
 		if (dev->type->pm) {
 			pm_dev_dbg(dev, state, "type ");
 			error = pm_op(dev, dev->type->pm, state);
-		} else if (dev->type->resume) {
-			pm_dev_dbg(dev, state, "legacy type ");
-			error = dev->type->resume(dev);
 		}
 		if (error)
 			goto End;
@@ -641,10 +638,6 @@ static int device_suspend(struct device 
 		if (dev->type->pm) {
 			pm_dev_dbg(dev, state, "type ");
 			error = pm_op(dev, dev->type->pm, state);
-		} else if (dev->type->suspend) {
-			pm_dev_dbg(dev, state, "legacy type ");
-			error = dev->type->suspend(dev, state);
-			suspend_report_result(dev->type->suspend, error);
 		}
 		if (error)
 			goto End;
--- 0001/include/linux/device.h
+++ work/include/linux/device.h	2009-06-01 17:00:20.000000000 +0900
@@ -293,9 +293,6 @@ struct device_type {
 	char *(*nodename)(struct device *dev);
 	void (*release)(struct device *dev);
 
-	int (*suspend)(struct device *dev, pm_message_t state);
-	int (*resume)(struct device *dev);
-
 	struct dev_pm_ops *pm;
 };
 

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

* Re: [PATCH][RFC] pm: remove device_type suspend()/resume()
  2009-06-01 10:38 [PATCH][RFC] pm: remove device_type suspend()/resume() Magnus Damm
@ 2009-06-01 18:40 ` Rafael J. Wysocki
  2009-06-01 18:56   ` Alan Stern
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2009-06-01 18:40 UTC (permalink / raw)
  To: Magnus Damm, gregkh; +Cc: linux-pm

On Monday 01 June 2009, Magnus Damm wrote:
> From: Magnus Damm <damm@igel.co.jp>
> 
> This patch removes the legacy callbacks ->suspend() and
> ->resume() from struct device_type. These callbacks seem
> unused, and new code should instead make use of struct
> dev_pm_ops.
> 
> Signed-off-by: Magnus Damm <damm@igel.co.jp>

This is fine by me.

Greg, Pavel, Alan, any objections?

Rafael


> ---
> 
>  Only lightly compile tested on my laptop, could use some
>  multi-arch build farm verification.
> 
>  drivers/base/power/main.c |    7 -------
>  include/linux/device.h    |    3 ---
>  2 files changed, 10 deletions(-)
> 
> --- 0001/drivers/base/power/main.c
> +++ work/drivers/base/power/main.c	2009-06-01 17:07:23.000000000 +0900
> @@ -399,9 +399,6 @@ static int device_resume(struct device *
>  		if (dev->type->pm) {
>  			pm_dev_dbg(dev, state, "type ");
>  			error = pm_op(dev, dev->type->pm, state);
> -		} else if (dev->type->resume) {
> -			pm_dev_dbg(dev, state, "legacy type ");
> -			error = dev->type->resume(dev);
>  		}
>  		if (error)
>  			goto End;
> @@ -641,10 +638,6 @@ static int device_suspend(struct device 
>  		if (dev->type->pm) {
>  			pm_dev_dbg(dev, state, "type ");
>  			error = pm_op(dev, dev->type->pm, state);
> -		} else if (dev->type->suspend) {
> -			pm_dev_dbg(dev, state, "legacy type ");
> -			error = dev->type->suspend(dev, state);
> -			suspend_report_result(dev->type->suspend, error);
>  		}
>  		if (error)
>  			goto End;
> --- 0001/include/linux/device.h
> +++ work/include/linux/device.h	2009-06-01 17:00:20.000000000 +0900
> @@ -293,9 +293,6 @@ struct device_type {
>  	char *(*nodename)(struct device *dev);
>  	void (*release)(struct device *dev);
>  
> -	int (*suspend)(struct device *dev, pm_message_t state);
> -	int (*resume)(struct device *dev);
> -
>  	struct dev_pm_ops *pm;
>  };

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

* Re: [PATCH][RFC] pm: remove device_type suspend()/resume()
  2009-06-01 18:40 ` Rafael J. Wysocki
@ 2009-06-01 18:56   ` Alan Stern
  2009-06-01 19:59   ` Pavel Machek
  2009-06-01 21:02   ` Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: Alan Stern @ 2009-06-01 18:56 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-pm, gregkh

On Mon, 1 Jun 2009, Rafael J. Wysocki wrote:

> On Monday 01 June 2009, Magnus Damm wrote:
> > From: Magnus Damm <damm@igel.co.jp>
> > 
> > This patch removes the legacy callbacks ->suspend() and
> > ->resume() from struct device_type. These callbacks seem
> > unused, and new code should instead make use of struct
> > dev_pm_ops.
> > 
> > Signed-off-by: Magnus Damm <damm@igel.co.jp>
> 
> This is fine by me.
> 
> Greg, Pavel, Alan, any objections?

No objections from me.

Alan Stern

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

* Re: [PATCH][RFC] pm: remove device_type suspend()/resume()
  2009-06-01 18:40 ` Rafael J. Wysocki
  2009-06-01 18:56   ` Alan Stern
@ 2009-06-01 19:59   ` Pavel Machek
  2009-06-01 21:02   ` Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2009-06-01 19:59 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-pm, gregkh

On Mon 2009-06-01 20:40:57, Rafael J. Wysocki wrote:
> On Monday 01 June 2009, Magnus Damm wrote:
> > From: Magnus Damm <damm@igel.co.jp>
> > 
> > This patch removes the legacy callbacks ->suspend() and
> > ->resume() from struct device_type. These callbacks seem
> > unused, and new code should instead make use of struct
> > dev_pm_ops.
> > 
> > Signed-off-by: Magnus Damm <damm@igel.co.jp>
> 
> This is fine by me.
> 
> Greg, Pavel, Alan, any objections?

Ok with me.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH][RFC] pm: remove device_type suspend()/resume()
  2009-06-01 18:40 ` Rafael J. Wysocki
  2009-06-01 18:56   ` Alan Stern
  2009-06-01 19:59   ` Pavel Machek
@ 2009-06-01 21:02   ` Greg KH
  2009-06-01 22:47     ` Rafael J. Wysocki
  2 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2009-06-01 21:02 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-pm

On Mon, Jun 01, 2009 at 08:40:57PM +0200, Rafael J. Wysocki wrote:
> On Monday 01 June 2009, Magnus Damm wrote:
> > From: Magnus Damm <damm@igel.co.jp>
> > 
> > This patch removes the legacy callbacks ->suspend() and
> > ->resume() from struct device_type. These callbacks seem
> > unused, and new code should instead make use of struct
> > dev_pm_ops.
> > 
> > Signed-off-by: Magnus Damm <damm@igel.co.jp>
> 
> This is fine by me.
> 
> Greg, Pavel, Alan, any objections?

Nope:
	Acked-by: Greg Kroah-Hartman <gregkh@suse.de>

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

* Re: [PATCH][RFC] pm: remove device_type suspend()/resume()
  2009-06-01 21:02   ` Greg KH
@ 2009-06-01 22:47     ` Rafael J. Wysocki
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2009-06-01 22:47 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-pm

On Monday 01 June 2009, Greg KH wrote:
> On Mon, Jun 01, 2009 at 08:40:57PM +0200, Rafael J. Wysocki wrote:
> > On Monday 01 June 2009, Magnus Damm wrote:
> > > From: Magnus Damm <damm@igel.co.jp>
> > > 
> > > This patch removes the legacy callbacks ->suspend() and
> > > ->resume() from struct device_type. These callbacks seem
> > > unused, and new code should instead make use of struct
> > > dev_pm_ops.
> > > 
> > > Signed-off-by: Magnus Damm <damm@igel.co.jp>
> > 
> > This is fine by me.
> > 
> > Greg, Pavel, Alan, any objections?
> 
> Nope:
> 	Acked-by: Greg Kroah-Hartman <gregkh@suse.de>

Great, thanks!

if you don't mind, I'm going to take it to my tree.

Best,
Rafael

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

end of thread, other threads:[~2009-06-01 22:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-01 10:38 [PATCH][RFC] pm: remove device_type suspend()/resume() Magnus Damm
2009-06-01 18:40 ` Rafael J. Wysocki
2009-06-01 18:56   ` Alan Stern
2009-06-01 19:59   ` Pavel Machek
2009-06-01 21:02   ` Greg KH
2009-06-01 22:47     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox