]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/msm/hdmi: Simplify with dev_of_node()
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Wed, 11 Mar 2026 20:17:25 +0000 (21:17 +0100)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Wed, 25 Mar 2026 06:06:09 +0000 (08:06 +0200)
Simplify chain of pointer dereferences with dev_of_node() which also
checks if 'dev' argument is non-NULL.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/711167/
Link: https://lore.kernel.org/r/20260311-drm-msm-hdmi-cleanup-v1-1-c5535245f6de@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drivers/gpu/drm/msm/hdmi/hdmi.c

index 368d6d56c4fae24d75d4508908cf90d8670c1595..09fda95310804a2391b4a0f10f3d83605f9c553c 100644 (file)
@@ -91,7 +91,7 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi)
        struct platform_device *phy_pdev;
        struct device_node *phy_node;
 
-       phy_node = of_parse_phandle(pdev->dev.of_node, "phys", 0);
+       phy_node = of_parse_phandle(dev_of_node(&pdev->dev), "phys", 0);
        if (!phy_node) {
                DRM_DEV_ERROR(&pdev->dev, "cannot find phy device\n");
                return -ENXIO;
@@ -287,7 +287,7 @@ static int msm_hdmi_dev_probe(struct platform_device *pdev)
        spin_lock_init(&hdmi->reg_lock);
        mutex_init(&hdmi->state_mutex);
 
-       ret = drm_of_find_panel_or_bridge(pdev->dev.of_node, 1, 0, NULL, &hdmi->next_bridge);
+       ret = drm_of_find_panel_or_bridge(dev_of_node(dev), 1, 0, NULL, &hdmi->next_bridge);
        if (ret && ret != -ENODEV)
                return ret;