[PATCH] drm/lima: Handle dma_set_coherent_mask error codes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux