[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211206023530.1662840-1-jiasheng@iscas.ac.cn>
Date: Mon, 6 Dec 2021 10:35:30 +0800
From: Jiasheng Jiang <jiasheng@...as.ac.cn>
To: yuq825@...il.com, airlied@...ux.ie, daniel@...ll.ch,
p.zabel@...gutronix.de, lgirdwood@...il.com, broonie@...nel.org
Cc: dri-devel@...ts.freedesktop.org, lima@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] drm/lima: Handle dma_set_coherent_mask error codes
The return value of dma_set_coherent_mask() is not always 0.
To catch the exception in case that dma is not support the mask.
Fixes: a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
drivers/gpu/drm/lima/lima_device.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/lima/lima_device.c b/drivers/gpu/drm/lima/lima_device.c
index 65fdca366e41..75e9a2060b47 100644
--- a/drivers/gpu/drm/lima/lima_device.c
+++ b/drivers/gpu/drm/lima/lima_device.c
@@ -356,7 +356,9 @@ int lima_device_init(struct lima_device *ldev)
struct platform_device *pdev = to_platform_device(ldev->dev);
int err, i;
- dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
+ err = dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
+ if (err)
+ return err;
err = lima_clk_init(ldev);
if (err)
--
2.25.1
Powered by blists - more mailing lists