[PATCH] drm/hisilicon: remove redundant when devm_kzalloc failed

Bernard Zhao bernard at vivo.com
Tue Feb 2 12:10:37 UTC 2021


Line 852 DRM_ERROR is redundant because memory alloc already
prints an error when failed.

Signed-off-by: Bernard Zhao <bernard at vivo.com>
---
 drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
index 00e87c290796..8491d8267f07 100644
--- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
+++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
@@ -852,10 +852,9 @@ static int dsi_probe(struct platform_device *pdev)
 	int ret;
 
 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-	if (!data) {
-		DRM_ERROR("failed to allocate dsi data.\n");
+	if (!data)
 		return -ENOMEM;
-	}
+
 	dsi = &data->dsi;
 	ctx = &data->ctx;
 	dsi->ctx = ctx;
-- 
2.29.0



More information about the dri-devel mailing list