mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/omap/dss: Use syscon_regmap_lookup_by_phandle_args
Date: Tue, 14 Jan 2025 15:43:46 +0100	[thread overview]
Message-ID: <d0fdf2c5-402d-49c1-a524-76943a24ecda@linaro.org> (raw)
In-Reply-To: <9b54bb98-0d96-4c48-9500-4e754889d795@ideasonboard.com>

On 14/01/2025 15:23, Tomi Valkeinen wrote:
> Hi,
> 
> On 12/01/2025 15:46, Krzysztof Kozlowski wrote:
>> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
>> syscon_regmap_lookup_by_phandle() combined with getting the syscon
>> argument.  Except simpler code this annotates within one line that given
>> phandle has arguments, so grepping for code would be easier.
>>
>> There is also no real benefit in printing errors on missing syscon
>> argument, because this is done just too late: runtime check on
>> static/build-time data.  Dtschema and Devicetree bindings offer the
>> static/build-time check for this already.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>   drivers/gpu/drm/omapdrm/dss/dss.c | 14 ++++----------
>>   1 file changed, 4 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
>> index 7b2df3185de4..692df747e2ae 100644
>> --- a/drivers/gpu/drm/omapdrm/dss/dss.c
>> +++ b/drivers/gpu/drm/omapdrm/dss/dss.c
>> @@ -1236,21 +1236,15 @@ static int dss_video_pll_probe(struct dss_device *dss)
>>   	if (!np)
>>   		return 0;
>>   
>> -	if (of_property_read_bool(np, "syscon-pll-ctrl")) {
>> -		dss->syscon_pll_ctrl = syscon_regmap_lookup_by_phandle(np,
>> -			"syscon-pll-ctrl");
>> +	if (of_property_present(np, "syscon-pll-ctrl")) {

I see now that I combined two changes I wanted to split. This should be
a separate commit.

>> +		dss->syscon_pll_ctrl =
>> +			syscon_regmap_lookup_by_phandle_args(np, "syscon-pll-ctrl",
>> +							     1, &dss->syscon_pll_ctrl_offset);
>>   		if (IS_ERR(dss->syscon_pll_ctrl)) {
>>   			dev_err(&pdev->dev,
>>   				"failed to get syscon-pll-ctrl regmap\n");
>>   			return PTR_ERR(dss->syscon_pll_ctrl);
>>   		}
>> -
>> -		if (of_property_read_u32_index(np, "syscon-pll-ctrl", 1,
>> -				&dss->syscon_pll_ctrl_offset)) {
>> -			dev_err(&pdev->dev,
>> -				"failed to get syscon-pll-ctrl offset\n");
>> -			return -EINVAL;
>> -		}
>>   	}
>>   
>>   	pll_regulator = devm_regulator_get(&pdev->dev, "vdda_video");
> 
> Looks reasonable to me. Tested on dra76 evm.
> 
> I can push this to drm-misc-next later if I see no other comments.
> 
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Let me send a v2 with your tag.

Best regards,
Krzysztof

      reply	other threads:[~2025-01-14 14:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-12 13:46 Krzysztof Kozlowski
2025-01-14 14:23 ` Tomi Valkeinen
2025-01-14 14:43   ` Krzysztof Kozlowski [this message]

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=d0fdf2c5-402d-49c1-a524-76943a24ecda@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=tzimmermann@suse.de \
    /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®