Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/dp: move next_bridge handling to dp_display

Remove two levels of indirection and fetch next bridge directly in
dp_display_probe_tail().

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/576126/
Link: https://lore.kernel.org/r/20240126-dp-power-parser-cleanup-v3-14-098d5f581dd3@linaro.org

+14 -57
+14 -29
drivers/gpu/drm/msm/dp/dp_display.c
··· 1196 1196 return NULL; 1197 1197 } 1198 1198 1199 - static int dp_display_get_next_bridge(struct msm_dp *dp); 1200 - 1201 1199 static int dp_display_probe_tail(struct device *dev) 1202 1200 { 1203 1201 struct msm_dp *dp = dev_get_drvdata(dev); 1204 1202 int ret; 1205 1203 1206 - ret = dp_display_get_next_bridge(dp); 1207 - if (ret) 1208 - return ret; 1204 + /* 1205 + * External bridges are mandatory for eDP interfaces: one has to 1206 + * provide at least an eDP panel (which gets wrapped into panel-bridge). 1207 + * 1208 + * For DisplayPort interfaces external bridges are optional, so 1209 + * silently ignore an error if one is not present (-ENODEV). 1210 + */ 1211 + dp->next_bridge = devm_drm_of_get_bridge(&dp->pdev->dev, dp->pdev->dev.of_node, 1, 0); 1212 + if (IS_ERR(dp->next_bridge)) { 1213 + ret = PTR_ERR(dp->next_bridge); 1214 + dp->next_bridge = NULL; 1215 + if (dp->is_edp || ret != -ENODEV) 1216 + return ret; 1217 + } 1209 1218 1210 1219 ret = component_add(dev, &dp_display_comp_ops); 1211 1220 if (ret) ··· 1405 1396 DRM_ERROR("failed to initialize debug, rc = %d\n", rc); 1406 1397 dp->debug = NULL; 1407 1398 } 1408 - } 1409 - 1410 - static int dp_display_get_next_bridge(struct msm_dp *dp) 1411 - { 1412 - int rc; 1413 - struct dp_display_private *dp_priv; 1414 - 1415 - dp_priv = container_of(dp, struct dp_display_private, dp_display); 1416 - 1417 - /* 1418 - * External bridges are mandatory for eDP interfaces: one has to 1419 - * provide at least an eDP panel (which gets wrapped into panel-bridge). 1420 - * 1421 - * For DisplayPort interfaces external bridges are optional, so 1422 - * silently ignore an error if one is not present (-ENODEV). 1423 - */ 1424 - rc = devm_dp_parser_find_next_bridge(&dp->pdev->dev, dp_priv->parser); 1425 - if (!dp->is_edp && rc == -ENODEV) 1426 - return 0; 1427 - 1428 - if (!rc) 1429 - dp->next_bridge = dp_priv->parser->next_bridge; 1430 - 1431 - return rc; 1432 1399 } 1433 1400 1434 1401 int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev,
-14
drivers/gpu/drm/msm/dp/dp_parser.c
··· 24 24 return 0; 25 25 } 26 26 27 - int devm_dp_parser_find_next_bridge(struct device *dev, struct dp_parser *parser) 28 - { 29 - struct platform_device *pdev = parser->pdev; 30 - struct drm_bridge *bridge; 31 - 32 - bridge = devm_drm_of_get_bridge(dev, pdev->dev.of_node, 1, 0); 33 - if (IS_ERR(bridge)) 34 - return PTR_ERR(bridge); 35 - 36 - parser->next_bridge = bridge; 37 - 38 - return 0; 39 - } 40 - 41 27 static int dp_parser_parse(struct dp_parser *parser) 42 28 { 43 29 int rc = 0;
-14
drivers/gpu/drm/msm/dp/dp_parser.h
··· 21 21 struct dp_parser { 22 22 struct platform_device *pdev; 23 23 struct phy *phy; 24 - struct drm_bridge *next_bridge; 25 24 }; 26 25 27 26 /** ··· 35 36 * can be parsed using this module. 36 37 */ 37 38 struct dp_parser *dp_parser_get(struct platform_device *pdev); 38 - 39 - /** 40 - * devm_dp_parser_find_next_bridge() - find an additional bridge to DP 41 - * 42 - * @dev: device to tie bridge lifetime to 43 - * @parser: dp_parser data from client 44 - * 45 - * This function is used to find any additional bridge attached to 46 - * the DP controller. The eDP interface requires a panel bridge. 47 - * 48 - * Return: 0 if able to get the bridge, otherwise negative errno for failure. 49 - */ 50 - int devm_dp_parser_find_next_bridge(struct device *dev, struct dp_parser *parser); 51 39 52 40 #endif