diff options
author | Eric Anholt <eric@anholt.net> | 2016-07-26 23:47:12 +0300 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-08-20 05:17:30 +0300 |
commit | 163195fc12cae0c8b5c0d74d3ba8d2c5f81773bc (patch) | |
tree | fb1fae850e1adb11ae9ffe85faded1e53135d60c /drivers/gpu/drm | |
parent | ece7267dccf0e9e08cb6e8dc6b7ad2be9c4eb444 (diff) | |
download | linux-163195fc12cae0c8b5c0d74d3ba8d2c5f81773bc.tar.xz |
drm/vc4: Fix handling of a pm_runtime_get_sync() success case.
If the device was already up, a 1 is returned instead of 0. We were
erroring out, leading the 3D driver to sometimes fail at screen
initialization (generally with ENOENT returned to it).
Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: af713795c59f ("drm/vc4: Add a getparam ioctl for getting the V3D identity regs.")
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_drv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 8b42d31a7f0e..9ecef9385491 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -57,21 +57,21 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, switch (args->param) { case DRM_VC4_PARAM_V3D_IDENT0: ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); - if (ret) + if (ret < 0) return ret; args->value = V3D_READ(V3D_IDENT0); pm_runtime_put(&vc4->v3d->pdev->dev); break; case DRM_VC4_PARAM_V3D_IDENT1: ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); - if (ret) + if (ret < 0) return ret; args->value = V3D_READ(V3D_IDENT1); pm_runtime_put(&vc4->v3d->pdev->dev); break; case DRM_VC4_PARAM_V3D_IDENT2: ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); - if (ret) + if (ret < 0) return ret; args->value = V3D_READ(V3D_IDENT2); pm_runtime_put(&vc4->v3d->pdev->dev); |