diff options
-rw-r--r-- | drivers/gpu/drm/i915/intel_runtime_pm.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index e2329768902c..4172e73212cd 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c | |||
@@ -2365,22 +2365,20 @@ bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv) | |||
2365 | { | 2365 | { |
2366 | struct drm_device *dev = dev_priv->dev; | 2366 | struct drm_device *dev = dev_priv->dev; |
2367 | struct device *device = &dev->pdev->dev; | 2367 | struct device *device = &dev->pdev->dev; |
2368 | int ret; | ||
2369 | 2368 | ||
2370 | if (!IS_ENABLED(CONFIG_PM)) | 2369 | if (IS_ENABLED(CONFIG_PM)) { |
2371 | return true; | 2370 | int ret = pm_runtime_get_if_in_use(device); |
2372 | 2371 | ||
2373 | ret = pm_runtime_get_if_in_use(device); | 2372 | /* |
2374 | 2373 | * In cases runtime PM is disabled by the RPM core and we get | |
2375 | /* | 2374 | * an -EINVAL return value we are not supposed to call this |
2376 | * In cases runtime PM is disabled by the RPM core and we get an | 2375 | * function, since the power state is undefined. This applies |
2377 | * -EINVAL return value we are not supposed to call this function, | 2376 | * atm to the late/early system suspend/resume handlers. |
2378 | * since the power state is undefined. This applies atm to the | 2377 | */ |
2379 | * late/early system suspend/resume handlers. | 2378 | WARN_ON_ONCE(ret < 0); |
2380 | */ | 2379 | if (ret <= 0) |
2381 | WARN_ON_ONCE(ret < 0); | 2380 | return false; |
2382 | if (ret <= 0) | 2381 | } |
2383 | return false; | ||
2384 | 2382 | ||
2385 | atomic_inc(&dev_priv->pm.wakeref_count); | 2383 | atomic_inc(&dev_priv->pm.wakeref_count); |
2386 | assert_rpm_wakelock_held(dev_priv); | 2384 | assert_rpm_wakelock_held(dev_priv); |