[PATCH -next] drm/ast: simplify the return expression of ast_* function

From: Liu Shixin
Date: Mon Sep 21 2020 - 04:04:11 EST


Simplify the return expression.

Signed-off-by: Liu Shixin <liushixin2@xxxxxxxxxx>
---
drivers/gpu/drm/ast/ast_drv.c | 7 +------
drivers/gpu/drm/ast/ast_mode.c | 7 +------
2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index f0b4af1c390a..a2a3f32260f9 100644
--- a/drivers/gpu/drm/ast/ast_drv.c
+++ b/drivers/gpu/drm/ast/ast_drv.c
@@ -160,15 +160,10 @@ static int ast_drm_thaw(struct drm_device *dev)

static int ast_drm_resume(struct drm_device *dev)
{
- int ret;
-
if (pci_enable_device(dev->pdev))
return -EIO;

- ret = ast_drm_thaw(dev);
- if (ret)
- return ret;
- return 0;
+ return ast_drm_thaw(dev);
}

static int ast_pm_suspend(struct device *dev)
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 834a156e3a75..4dca4ff01d41 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -636,18 +636,13 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
struct drm_framebuffer *fb = new_state->fb;
struct drm_crtc *crtc = new_state->crtc;
struct ast_private *ast;
- int ret;

if (!crtc || !fb)
return 0;

ast = to_ast_private(plane->dev);

- ret = ast_cursor_blit(ast, fb);
- if (ret)
- return ret;
-
- return 0;
+ return ast_cursor_blit(ast, fb);
}

static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane,
--
2.25.1