]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
dmaengine: xilinx: frmbuf: Make max-width and max-height mandatory properties
authorVishal Sagar <vishal.sagar@xilinx.com>
Thu, 14 Mar 2019 10:55:52 +0000 (03:55 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 15 Mar 2019 09:32:51 +0000 (10:32 +0100)
This patch makes the xlnx,max-width and xlnx,max-height mandatory
properties in the device tree node. Since this breaks backward
compatibility, a warning message is added.

Signed-off-by: Vishal Sagar <vishal.sagar@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
drivers/dma/xilinx/xilinx_frmbuf.c

index 42c9c6d58bd4f9730b1b511b4bad379d9465d9fb..a135af17129ba28c04ac2e6d67726895c62c5f00 100644 (file)
@@ -1538,7 +1538,8 @@ static int xilinx_frmbuf_probe(struct platform_device *pdev)
 
        err = of_property_read_u32(node, "xlnx,max-height", &xdev->max_height);
        if (err < 0) {
-               xdev->max_height = XILINX_FRMBUF_MAX_HEIGHT;
+               dev_err(xdev->dev, "xlnx,max-height is missing!");
+               return -EINVAL;
        } else if (xdev->max_height > XILINX_FRMBUF_MAX_HEIGHT ||
                   xdev->max_height < XILINX_FRMBUF_MIN_HEIGHT) {
                dev_err(&pdev->dev, "Invalid height in dt");
@@ -1547,7 +1548,8 @@ static int xilinx_frmbuf_probe(struct platform_device *pdev)
 
        err = of_property_read_u32(node, "xlnx,max-width", &xdev->max_width);
        if (err < 0) {
-               xdev->max_width = XILINX_FRMBUF_MAX_WIDTH;
+               dev_err(xdev->dev, "xlnx,max-width is missing!");
+               return -EINVAL;
        } else if (xdev->max_width > XILINX_FRMBUF_MAX_WIDTH ||
                   xdev->max_width < XILINX_FRMBUF_MIN_WIDTH) {
                dev_err(&pdev->dev, "Invalid width in dt");