2021-02-02 12:13:50

by 赵军奎

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

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

Signed-off-by: Bernard Zhao <[email protected]>
---
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