aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 66fe271c2544..c32e6f974d4a 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -370,9 +370,6 @@ int subsys_virtual_register(struct bus_type *subsys,
370 * @devnode: Callback to provide the devtmpfs. 370 * @devnode: Callback to provide the devtmpfs.
371 * @class_release: Called to release this class. 371 * @class_release: Called to release this class.
372 * @dev_release: Called to release the device. 372 * @dev_release: Called to release the device.
373 * @suspend: Used to put the device to sleep mode, usually to a low power
374 * state.
375 * @resume: Used to bring the device from the sleep mode.
376 * @shutdown_pre: Called at shut-down time before driver shutdown. 373 * @shutdown_pre: Called at shut-down time before driver shutdown.
377 * @ns_type: Callbacks so sysfs can detemine namespaces. 374 * @ns_type: Callbacks so sysfs can detemine namespaces.
378 * @namespace: Namespace of the device belongs to this class. 375 * @namespace: Namespace of the device belongs to this class.
@@ -400,8 +397,6 @@ struct class {
400 void (*class_release)(struct class *class); 397 void (*class_release)(struct class *class);
401 void (*dev_release)(struct device *dev); 398 void (*dev_release)(struct device *dev);
402 399
403 int (*suspend)(struct device *dev, pm_message_t state);
404 int (*resume)(struct device *dev);
405 int (*shutdown_pre)(struct device *dev); 400 int (*shutdown_pre)(struct device *dev);
406 401
407 const struct kobj_ns_type_operations *ns_type; 402 const struct kobj_ns_type_operations *ns_type;