Merge tag 'drm-misc-next-fixes-2021-04-22' of git://anongit.freedesktop.org/drm/drm...
authorDave Airlie <airlied@redhat.com>
Fri, 23 Apr 2021 02:56:21 +0000 (12:56 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 23 Apr 2021 03:53:07 +0000 (13:53 +1000)
A few fixes for the next merge window, with some build fixes for anx7625
and lt8912b bridges, incorrect error handling for lt8912b and TTM, and
one fix for TTM page limit accounting.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20210422163329.dvbuwre3akwdmzjt@gilmour
1  2 
drivers/gpu/drm/bridge/Kconfig
drivers/gpu/drm/bridge/lontium-lt8912b.c

@@@ -55,7 -55,7 +55,7 @@@ config DRM_DISPLAY_CONNECTO
        depends on OF
        help
          Driver for display connectors with support for DDC and hot-plug
 -        detection. Most display controller handle display connectors
 +        detection. Most display controllers handle display connectors
          internally and don't need this driver, but the DRM subsystem is
          moving towards separating connector handling from display controllers
          on ARM-based platforms. Saying Y here when this driver is not needed
@@@ -66,6 -66,7 +66,7 @@@ config DRM_LONTIUM_LT8912
        depends on OF
        select DRM_PANEL_BRIDGE
        select DRM_KMS_HELPER
+       select DRM_MIPI_DSI
        select REGMAP_I2C
        help
          Driver for Lontium LT8912B DSI to HDMI bridge
@@@ -81,6 -82,7 +82,7 @@@ config DRM_LONTIUM_LT961
        depends on OF
        select DRM_PANEL_BRIDGE
        select DRM_KMS_HELPER
+       select DRM_MIPI_DSI
        select REGMAP_I2C
        help
          Driver for Lontium LT9611 DSI to HDMI bridge
@@@ -94,6 -96,7 +96,7 @@@ config DRM_LONTIUM_LT9611UX
        depends on OF
        select DRM_PANEL_BRIDGE
        select DRM_KMS_HELPER
+       select DRM_MIPI_DSI
        select REGMAP_I2C
        help
          Driver for Lontium LT9611UXC DSI to HDMI bridge
@@@ -210,7 -213,6 +213,7 @@@ config DRM_TOSHIBA_TC35876
        tristate "TC358762 DSI/DPI bridge"
        depends on OF
        select DRM_MIPI_DSI
 +      select DRM_KMS_HELPER
        select DRM_PANEL_BRIDGE
        help
          Toshiba TC358762 DSI/DPI bridge driver.
@@@ -5,7 -5,6 +5,7 @@@
  
  #include <linux/device.h>
  #include <linux/delay.h>
 +#include <linux/gpio/consumer.h>
  #include <linux/i2c.h>
  #include <linux/gpio.h>
  #include <linux/of_gpio.h>
@@@ -622,7 -621,8 +622,8 @@@ static int lt8912_parse_dt(struct lt891
  {
        struct gpio_desc *gp_reset;
        struct device *dev = lt->dev;
-       int ret = 0;
+       int ret;
+       int data_lanes;
        struct device_node *port_node;
        struct device_node *endpoint;
  
        lt->gp_reset = gp_reset;
  
        endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
-       if (IS_ERR(endpoint)) {
-               ret = PTR_ERR(endpoint);
-               goto end;
-       }
+       if (!endpoint)
+               return -ENODEV;
  
-       lt->data_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
+       data_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
        of_node_put(endpoint);
+       if (data_lanes < 0) {
+               dev_err(lt->dev, "%s: Bad data-lanes property\n", __func__);
+               return data_lanes;
+       }
+       lt->data_lanes = data_lanes;
  
        lt->host_node = of_graph_get_remote_node(dev->of_node, 0, -1);
        if (!lt->host_node) {
                dev_err(lt->dev, "%s: Failed to get remote port\n", __func__);
-               ret = -ENODEV;
-               goto end;
+               return -ENODEV;
        }
  
        port_node = of_graph_get_remote_node(dev->of_node, 1, -1);
        }
  
        lt->hdmi_port = of_drm_find_bridge(port_node);
-       if (IS_ERR(lt->hdmi_port)) {
+       if (!lt->hdmi_port) {
                dev_err(lt->dev, "%s: Failed to get hdmi port\n", __func__);
-               ret = PTR_ERR(lt->hdmi_port);
-               of_node_put(lt->host_node);
-               goto end;
+               ret = -ENODEV;
+               goto err_free_host_node;
        }
  
        if (!of_device_is_compatible(port_node, "hdmi-connector")) {
                dev_err(lt->dev, "%s: Failed to get hdmi port\n", __func__);
                ret = -EINVAL;
+               goto err_free_host_node;
        }
  
        of_node_put(port_node);
- end:
-       return ret;
+       return 0;
  
  err_free_host_node:
+       of_node_put(port_node);
        of_node_put(lt->host_node);
        return ret;
  }