Skip to contentSkip to conversation

pm: remove bus_type suspend_late()/resume_early()

RFC PATCH In review Magnus Damm 2 participants 2 messages May 15, 2009

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

RFC PATCH 1/1 pm: remove bus_type suspend_late()/resume_early()

From: Magnus Damm <[email protected]>

Remove the ->suspend_late() and ->resume_early() callbacks from struct bus_type. These callbacks are legacy stuff at this point and since there seem to be no in-tree users we may as well remove them. New users should use dev_pm_ops.

---

This patch is almost too good to be true so there must be something wrong. I did however spend quite some time grepping and I could not find any in-tree users.

 drivers/base/power/main.c |    7 -------
 include/linux/device.h    |    2 --
 2 files changed, 9 deletions(-)
include/linux/device.h +0 -2
@@ -62,8 +62,6 @@ struct bus_type {
 	void (*shutdown)(struct device *dev);
 
 	int (*suspend)(struct device *dev, pm_message_t state);
-	int (*suspend_late)(struct device *dev, pm_message_t state);
-	int (*resume_early)(struct device *dev);
 	int (*resume)(struct device *dev);
 
 	struct dev_pm_ops *pm;
drivers/base/power/main.c +0 -7
@@ -334,9 +334,6 @@ static int resume_device_noirq(struct de
 	if (dev->bus->pm) {
 		pm_dev_dbg(dev, state, "EARLY ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
-	} else if (dev->bus->resume_early) {
-		pm_dev_dbg(dev, state, "legacy EARLY ");
-		error = dev->bus->resume_early(dev);
 	}
  End:
 	TRACE_RESUME(error);
@@ -591,10 +588,6 @@ static int suspend_device_noirq(struct d
 	if (dev->bus->pm) {
 		pm_dev_dbg(dev, state, "LATE ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
-	} else if (dev->bus->suspend_late) {
-		pm_dev_dbg(dev, state, "legacy LATE ");
-		error = dev->bus->suspend_late(dev, state);
-		suspend_report_result(dev->bus->suspend_late, error);
 	}
 	return error;
 }
#1 lore raw
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Remove the ->suspend_late() and ->resume_early() callbacks from struct bus_type. These callbacks are legacy stuff at this point and since there seem to be no in-tree users we may as well remove them. New users should use dev_pm_ops.

OK

But please also have a look if they are not mentioned somewhere under Documentation .

Quoted 47 lines

---

This patch is almost too good to be true so there must be something wrong. I did however spend quite some time grepping and I could not find any in-tree users.

 drivers/base/power/main.c |    7 -------
 include/linux/device.h    |    2 --
 2 files changed, 9 deletions(-)
include/linux/device.h +0 -2
@@ -62,8 +62,6 @@ struct bus_type {
 	void (*shutdown)(struct device *dev);
 
 	int (*suspend)(struct device *dev, pm_message_t state);
-	int (*suspend_late)(struct device *dev, pm_message_t state);
-	int (*resume_early)(struct device *dev);
 	int (*resume)(struct device *dev);
 
 	struct dev_pm_ops *pm;
drivers/base/power/main.c +0 -7
@@ -334,9 +334,6 @@ static int resume_device_noirq(struct de
 	if (dev->bus->pm) {
 		pm_dev_dbg(dev, state, "EARLY ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
-	} else if (dev->bus->resume_early) {
-		pm_dev_dbg(dev, state, "legacy EARLY ");
-		error = dev->bus->resume_early(dev);
 	}
  End:
 	TRACE_RESUME(error);
@@ -591,10 +588,6 @@ static int suspend_device_noirq(struct d
 	if (dev->bus->pm) {
 		pm_dev_dbg(dev, state, "LATE ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
-	} else if (dev->bus->suspend_late) {
-		pm_dev_dbg(dev, state, "legacy LATE ");
-		error = dev->bus->suspend_late(dev, state);
-		suspend_report_result(dev->bus->suspend_late, error);
 	}
 	return error;
 }