Skip to contentSkip to conversation

pm: remove device_type suspend()/resume()

RFC PATCH In review Magnus Damm 5 participants 6 messages Jun 1, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 pm: remove device_type suspend()/resume()

From: Magnus Damm <[email protected]>

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.

---

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(-)
drivers/base/power/main.c +0 -7
@@ -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;
include/linux/device.h +0 -3
@@ -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;
 };
 
#1 lore raw
Quoted 8 lines · Magnus Damm

From: Magnus Damm <[email protected]>

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.

This is fine by me.

Greg, Pavel, Alan, any objections?

Rafael

Quoted 43 lines

---

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(-)
drivers/base/power/main.c +0 -7
@@ -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;
include/linux/device.h +0 -3
@@ -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;
 };
#2 lore raw
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Magnus Damm

From: Magnus Damm <[email protected]>

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.

Quoted 5 lines
Quoted 1 line

This is fine by me.

Greg, Pavel, Alan, any objections?

No objections from me.

Alan Stern

#3 lore raw
In reply to Rafael J. Wysocki
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Magnus Damm

From: Magnus Damm <[email protected]>

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.

Quoted 5 lines
Quoted 1 line

This is fine by me.

Greg, Pavel, Alan, any objections?

Ok with me.

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Acked-by
#4 lore raw
In reply to Rafael J. Wysocki
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Magnus Damm

From: Magnus Damm <[email protected]>

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.

Quoted 5 lines
Quoted 1 line

This is fine by me.

Greg, Pavel, Alan, any objections?

Nope:

#5 lore raw
Quoted 9 lines · Greg KH
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Magnus Damm

From: Magnus Damm <[email protected]>

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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

This is fine by me.

Greg, Pavel, Alan, any objections?

Nope:

Great, thanks!

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

Best,
Rafael