Skip to content

Commit 05aa55d

Browse files
ohadbcrjwysocki
authored andcommitted
PM / Runtime: Lenient generic runtime pm callbacks
Allow drivers, that belong to subsystems which use the generic runtime pm callbacks, not to define runtime pm suspend/resume handlers, by implicitly assuming success in such cases. This is needed to eliminate nop handlers that would otherwise be necessary by drivers which enable runtime pm, but don't need to do anything when their devices are runtime-suspended/resumed. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
1 parent 2d01971 commit 05aa55d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/base/power/generic_ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int pm_generic_runtime_suspend(struct device *dev)
4646
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
4747
int ret;
4848

49-
ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : -EINVAL;
49+
ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : 0;
5050

5151
return ret;
5252
}
@@ -65,7 +65,7 @@ int pm_generic_runtime_resume(struct device *dev)
6565
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
6666
int ret;
6767

68-
ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : -EINVAL;
68+
ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : 0;
6969

7070
return ret;
7171
}

0 commit comments

Comments
 (0)