MLK-21274-1 gpu/imx: lcdif: set 'dma_mask' for client devices
authorFancy Fang <chen.fang@nxp.com>
Wed, 27 Mar 2019 11:28:41 +0000 (19:28 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Since the client devices are allocated manually in this driver,
its 'dma_mask' will not be initialized before its probe start,
and this will cause the dma configure for the client devices to
give a warning message "DMA mask not set". So make 'dma_mask' to
point to its 'coherent_dma_mask' by default to avoid this warnning.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
drivers/gpu/imx/lcdif/lcdif-common.c

index 86b1069..45952fd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018 NXP
+ * Copyright 2018-2019 NXP
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -626,6 +626,12 @@ static int lcdif_add_client_devices(struct lcdif_soc *lcdif)
                pdev->dev.parent = dev;
                client_reg[i].pdata.of_node = of_node;
 
+               /* make child device 'dma_mask' to point to its
+                * coherent dma mask, otherwise later probe will
+                * print warning message: 'DMA mask not set'.
+                */
+               pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
+
                ret = platform_device_add_data(pdev, &client_reg[i].pdata,
                                               sizeof(client_reg[i].pdata));
                if (!ret)