未验证 提交 9e82ea0f 编写于 作者: J José Expósito 提交者: Robert Foss

drm/bridge: anx7625: switch to devm_drm_of_get_bridge

The function "drm_of_find_panel_or_bridge" has been deprecated in
favor of "devm_drm_of_get_bridge".

Switch to the new function and reduce boilerplate.
Signed-off-by: NJosé Expósito <jose.exposito89@gmail.com>
Reviewed-by: NMaxime Ripard <maxime@cerno.tech>
Signed-off-by: NRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220221072835.10032-1-jose.exposito89@gmail.com
上级 a134109c
......@@ -1611,8 +1611,6 @@ static int anx7625_parse_dt(struct device *dev,
struct anx7625_platform_data *pdata)
{
struct device_node *np = dev->of_node, *ep0;
struct drm_panel *panel;
int ret;
int bus_type, mipi_lanes;
anx7625_get_swing_setting(dev, pdata);
......@@ -1649,18 +1647,14 @@ static int anx7625_parse_dt(struct device *dev,
if (of_property_read_bool(np, "analogix,audio-enable"))
pdata->audio_en = 1;
ret = drm_of_find_panel_or_bridge(np, 1, 0, &panel, NULL);
if (ret < 0) {
if (ret == -ENODEV)
pdata->panel_bridge = devm_drm_of_get_bridge(dev, np, 1, 0);
if (IS_ERR(pdata->panel_bridge)) {
if (PTR_ERR(pdata->panel_bridge) == -ENODEV)
return 0;
return ret;
}
if (!panel)
return -ENODEV;
pdata->panel_bridge = devm_drm_panel_bridge_add(dev, panel);
if (IS_ERR(pdata->panel_bridge))
return PTR_ERR(pdata->panel_bridge);
}
DRM_DEV_DEBUG_DRIVER(dev, "get panel node.\n");
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册