mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Rob Clark <robin.clark@oss.qualcomm.com>,
	Dmitry Baryshkov <lumag@kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] drm/msm/hdmi: Simplify with dev_of_node()
Date: Thu, 12 Mar 2026 17:32:02 +0100	[thread overview]
Message-ID: <e1a5bc39-fabd-451c-b480-03ac9bf2720c@oss.qualcomm.com> (raw)
In-Reply-To: <hg2icue2e4oyr2pu2osjlbbcv5g2q6golwoabe3oy2bxhvhb6r@ku7aqp5jdovb>

On 12/03/2026 03:41, Dmitry Baryshkov wrote:
> On Wed, Mar 11, 2026 at 09:17:25PM +0100, Krzysztof Kozlowski wrote:
>> 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>
>> ---
>>  drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
>> index 5afac09c0d33..b1db1b597901 100644
>> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
>> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
>> @@ -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);
> 
> dev_of_node(&pdev->dev)?

Why? dev is already simpler.

Best regards,
Krzysztof

  reply	other threads:[~2026-03-12 16:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 20:17 [PATCH 0/7] drm/msm/hdmi: Simplify the code Krzysztof Kozlowski
2026-03-11 20:17 ` [PATCH 1/7] drm/msm/hdmi: Simplify with dev_of_node() Krzysztof Kozlowski
2026-03-12  2:41   ` Dmitry Baryshkov
2026-03-12 16:32     ` Krzysztof Kozlowski [this message]
2026-03-13  0:48       ` Dmitry Baryshkov
2026-03-11 20:17 ` [PATCH 2/7] drm/msm/hdmi: Avoid double error print on msm_hdmi_get_phy() failure Krzysztof Kozlowski
2026-03-12  2:44   ` Dmitry Baryshkov
2026-03-11 20:17 ` [PATCH 3/7] drm/msm/hdmi: Simplify with local 'dev' variable Krzysztof Kozlowski
2026-03-12  2:41   ` Dmitry Baryshkov
2026-03-11 20:17 ` [PATCH 4/7] drm/msm/hdmi: Consistently use u32 instead of uint32_t Krzysztof Kozlowski
2026-03-12  2:42   ` Dmitry Baryshkov
2026-03-11 20:17 ` [PATCH 5/7] drm/msm/hdmi: Drop redundant 'int' for longs Krzysztof Kozlowski
2026-03-12  2:43   ` Dmitry Baryshkov
2026-03-11 20:17 ` [PATCH 6/7] drm/msm/hdmi_bridge: Simplify register bit updates Krzysztof Kozlowski
2026-03-12  2:44   ` Dmitry Baryshkov
2026-03-11 20:17 ` [PATCH 7/7] drm/msm/hdmi_hdcp: " Krzysztof Kozlowski
2026-03-12  2:43   ` Dmitry Baryshkov
2026-03-27 19:47 ` [PATCH 0/7] drm/msm/hdmi: Simplify the code Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1a5bc39-fabd-451c-b480-03ac9bf2720c@oss.qualcomm.com \
    --to=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®