Skip to contentSkip to conversation

drm/ast: simplify the return expression of ast_* function

PATCH New Liu Shixin 1 participant 1 message Sep 21, 2020

Subsystems (3)
lore
Share & tools
lore

Liu Shixin

author
#0 lore raw

PATCH 1/1 drm/ast: simplify the return expression of ast_* function

Simplify the return expression.

---
 drivers/gpu/drm/ast/ast_drv.c  | 7 +------
 drivers/gpu/drm/ast/ast_mode.c | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)
drivers/gpu/drm/ast/ast_drv.c +1 -6
index f0b4af1c390a..a2a3f32260f9 100644
@@ -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)
drivers/gpu/drm/ast/ast_mode.c +1 -6
index 834a156e3a75..4dca4ff01d41 100644
@@ -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,
Signature · 1 line
2.25.1