]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
v4l: xilinx-vpss-csc: Make max width and height mandatory properties
authorVishal Sagar <vishal.sagar@xilinx.com>
Thu, 14 Mar 2019 10:55:54 +0000 (03:55 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 15 Mar 2019 09:32:53 +0000 (10:32 +0100)
This patch makes xlnx,max-width and xlnx,max-height as mandatory
properties. This breaks backward compatibility and a warning message is
added.

Signed-off-by: Vishal Sagar <vishal.sagar@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
drivers/media/platform/xilinx/xilinx-vpss-csc.c

index fd0eedad53eec3d68affb2cd3842eab1cdff5646..0d8da2f7be2711cb3af25a961e9fb9a0047f5cf1 100644 (file)
@@ -957,7 +957,8 @@ static int xcsc_parse_of(struct xcsc_dev *xcsc)
 
        rval = of_property_read_u32(node, "xlnx,max-height", &xcsc->max_height);
        if (rval < 0) {
-               xcsc->max_height = XV_CSC_MAX_HEIGHT;
+               dev_err(dev, "xlnx,max-height is missing!");
+               return -EINVAL;
        } else if (xcsc->max_height > XV_CSC_MAX_HEIGHT ||
                   xcsc->max_height < XV_CSC_MIN_HEIGHT) {
                dev_err(dev, "Invalid height in dt");
@@ -966,7 +967,8 @@ static int xcsc_parse_of(struct xcsc_dev *xcsc)
 
        rval = of_property_read_u32(node, "xlnx,max-width", &xcsc->max_width);
        if (rval < 0) {
-               xcsc->max_width = XV_CSC_MAX_WIDTH;
+               dev_err(dev, "xlnx,max-width is missing!");
+               return -EINVAL;
        } else if (xcsc->max_width > XV_CSC_MAX_WIDTH ||
                   xcsc->max_width < XV_CSC_MIN_WIDTH) {
                dev_err(dev, "Invalid width in dt");