diff options
author | Dave Airlie <airlied@redhat.com> | 2021-04-23 05:56:21 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2021-04-23 06:53:07 +0300 |
commit | a1a1ca70deb3ec600eeabb21de7f3f48aaae5695 (patch) | |
tree | f60ddfab1b78b8d3279d39775dce088bf04502af /drivers/gpu/drm/bridge/lontium-lt8912b.c | |
parent | af8352f1ff54c4fecf84e36315fd1928809a580b (diff) | |
parent | a4394b6d0a273941a75ebe86a86d6416d536ed0f (diff) | |
download | linux-a1a1ca70deb3ec600eeabb21de7f3f48aaae5695.tar.xz |
Merge tag 'drm-misc-next-fixes-2021-04-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
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
Diffstat (limited to 'drivers/gpu/drm/bridge/lontium-lt8912b.c')
-rw-r--r-- | drivers/gpu/drm/bridge/lontium-lt8912b.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c index 4f693123985b..443f1b47e031 100644 --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c @@ -622,7 +622,8 @@ static int lt8912_parse_dt(struct lt8912 *lt) { 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; @@ -636,19 +637,21 @@ static int lt8912_parse_dt(struct lt8912 *lt) 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); @@ -659,24 +662,23 @@ static int lt8912_parse_dt(struct lt8912 *lt) } 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; } |