Revert "Revert "Revert "drivercore: Avoid adding devices without pm_ops to dpm list"""
This reverts commit 04f65062030f157e8b7081b837e3121aeb2162a2.
Not able to add device with PM core and causing suspend/resume
issue in I2C client driver.pm_ops are removed from I2C bus type
and should fall back on client driver pm_ops.
Reverting this change as we are not able to register I2C
client devices with PM core.
Change-Id: I9941fd71241d3e6c301c43c61715266fdbc02214
Signed-off-by: Harry Yang <harryy@codeaurora.org>
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 35ab4d5..ac43d6f 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1116,13 +1116,7 @@
error = dpm_sysfs_add(dev);
if (error)
goto DPMError;
- if ((dev->pm_domain) || (dev->type && dev->type->pm)
- || (dev->class && (dev->class->pm || dev->class->resume))
- || (dev->bus && (dev->bus->pm || dev->bus->resume)) ||
- (dev->driver && dev->driver->pm)) {
- device_pm_add(dev);
- }
-
+ device_pm_add(dev);
if (MAJOR(dev->devt)) {
error = device_create_file(dev, &dev_attr_dev);