lkml.org 
[lkml]   [2021]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm/lima: Handle dma_set_coherent_mask error codes
Date
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@iscas.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
\
 
 \ /
  Last update: 2021-12-06 03:36    [W:0.038 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site