aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-09-25 08:56:44 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-09-25 17:58:37 -0400
commita380f2edef65b2447a043251bb3c00a9d2153a8b (patch)
tree86e0537d71efde49f666fecc6b64161b82f9fecf
parente19b205be43d11bff638cad4487008c48d21c103 (diff)
PM / core: Drop legacy class suspend/resume operations
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> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/power/main.c32
-rw-r--r--include/linux/device.h5
2 files changed, 9 insertions, 28 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 770b1539a083..12abcf6084a5 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -848,16 +848,10 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
848 goto Driver; 848 goto Driver;
849 } 849 }
850 850
851 if (dev->class) { 851 if (dev->class && dev->class->pm) {
852 if (dev->class->pm) { 852 info = "class ";
853 info = "class "; 853 callback = pm_op(dev->class->pm, state);
854 callback = pm_op(dev->class->pm, state); 854 goto Driver;
855 goto Driver;
856 } else if (dev->class->resume) {
857 info = "legacy class ";
858 callback = dev->class->resume;
859 goto End;
860 }
861 } 855 }
862 856
863 if (dev->bus) { 857 if (dev->bus) {
@@ -1508,17 +1502,10 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
1508 goto Run; 1502 goto Run;
1509 } 1503 }
1510 1504
1511 if (dev->class) { 1505 if (dev->class && dev->class->pm) {
1512 if (dev->class->pm) { 1506 info = "class ";
1513 info = "class "; 1507 callback = pm_op(dev->class->pm, state);
1514 callback = pm_op(dev->class->pm, state); 1508 goto Run;
1515 goto Run;
1516 } else if (dev->class->suspend) {
1517 pm_dev_dbg(dev, state, "legacy class ");
1518 error = legacy_suspend(dev, state, dev->class->suspend,
1519 "legacy class ");
1520 goto End;
1521 }
1522 } 1509 }
1523 1510
1524 if (dev->bus) { 1511 if (dev->bus) {
@@ -1862,8 +1849,7 @@ void device_pm_check_callbacks(struct device *dev)
1862 dev->power.no_pm_callbacks = 1849 dev->power.no_pm_callbacks =
1863 (!dev->bus || (pm_ops_is_empty(dev->bus->pm) && 1850 (!dev->bus || (pm_ops_is_empty(dev->bus->pm) &&
1864 !dev->bus->suspend && !dev->bus->resume)) && 1851 !dev->bus->suspend && !dev->bus->resume)) &&
1865 (!dev->class || (pm_ops_is_empty(dev->class->pm) && 1852 (!dev->class || pm_ops_is_empty(dev->class->pm)) &&
1866 !dev->class->suspend && !dev->class->resume)) &&
1867 (!dev->type || pm_ops_is_empty(dev->type->pm)) && 1853 (!dev->type || pm_ops_is_empty(dev->type->pm)) &&
1868 (!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) && 1854 (!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) &&
1869 (!dev->driver || (pm_ops_is_empty(dev->driver->pm) && 1855 (!dev->driver || (pm_ops_is_empty(dev->driver->pm) &&
diff --git a/include/linux/device.h b/include/linux/device.h
index 1d2607923a24..c1527f887050 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -372,9 +372,6 @@ int subsys_virtual_register(struct bus_type *subsys,
372 * @devnode: Callback to provide the devtmpfs. 372 * @devnode: Callback to provide the devtmpfs.
373 * @class_release: Called to release this class. 373 * @class_release: Called to release this class.
374 * @dev_release: Called to release the device. 374 * @dev_release: Called to release the device.
375 * @suspend: Used to put the device to sleep mode, usually to a low power
376 * state.
377 * @resume: Used to bring the device from the sleep mode.
378 * @shutdown_pre: Called at shut-down time before driver shutdown. 375 * @shutdown_pre: Called at shut-down time before driver shutdown.
379 * @ns_type: Callbacks so sysfs can detemine namespaces. 376 * @ns_type: Callbacks so sysfs can detemine namespaces.
380 * @namespace: Namespace of the device belongs to this class. 377 * @namespace: Namespace of the device belongs to this class.
@@ -402,8 +399,6 @@ struct class {
402 void (*class_release)(struct class *class); 399 void (*class_release)(struct class *class);
403 void (*dev_release)(struct device *dev); 400 void (*dev_release)(struct device *dev);
404 401
405 int (*suspend)(struct device *dev, pm_message_t state);
406 int (*resume)(struct device *dev);
407 int (*shutdown_pre)(struct device *dev); 402 int (*shutdown_pre)(struct device *dev);
408 403
409 const struct kobj_ns_type_operations *ns_type; 404 const struct kobj_ns_type_operations *ns_type;