Devicetree
 help / color / mirror / Atom feed
From: "Börge Strümpfel" <bstruempfel@data-modul.com>
To: Marek Vasut <marex@nabladev.com>
Cc: Marek Vasut <marex@denx.de>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	 Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	 Jernej Skrabec <jernej.skrabec@gmail.com>,
	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>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] drm/bridge: lt9211: Add drive-strength-microamp DT property
Date: Thu, 14 May 2026 13:20:49 +0200	[thread overview]
Message-ID: <agWuyCxPqwZ4ztVF@DATAMODULBOERGELINUX> (raw)
In-Reply-To: <8bf05bf2-66a3-49e0-972e-4ab7ad9f0ff0@nabladev.com>

On Wed, May 13, 2026 at 03:45:43PM +0200, Marek Vasut wrote:
> On 5/13/26 3:31 PM, Boerge Struempfel wrote:
> 
> [...]
> 
> > @@ -666,6 +675,26 @@ static int lt9211_parse_dt(struct lt9211 *ctx)
> >   
> >   	ctx->panel_bridge = panel_bridge;
> >   
> > +	ctx->lvds_hsdrv_isel = 8; /* default: 25 uA */
> > +	ret = of_property_read_u32(dev->of_node, "drive-strength-microamp",
> > +				   &microamp);
> 
> if (ret && ret != -EINVAL) {
>    ... error handling ...
>    return ret;
> }
> 
> Then you won't need the if (!ret) conditional and can reduce indent.

Thank you for this suggestion. We will than need to do the lookup even
in case of no value being supplied, but that would make the code
cleaner. Therefore I am changing this in v3.
> 
> I also wonder whether it wouldn't be better to simply bail with 
> dev_err_probe() if the property is invalid, let the user know they 
> should fix their DTs before it is too late.
Ok. I'll change that in v3.
> 
> > +	if (!ret) {
> > +		for (i = 0; i < ARRAY_SIZE(lt9211_hsdrv_microamp); i++) {
> > +			if (lt9211_hsdrv_microamp[i] == microamp) {
> > +				ctx->lvds_hsdrv_isel = i;
> > +				break;
> > +			}
> > +		}
> > +		if (i == ARRAY_SIZE(lt9211_hsdrv_microamp)) {
> > +			dev_err(dev, "Invalid drive-strength-microamp value %u\n",
> > +				microamp);
> > +			return -EINVAL;
> > +		}
> 
> [...]
> 
> > +
> >   	return 0;
> >   }
> 

-- 
Best regards,
Börge Strümpfel

DATA MODUL AG
Landsberger Str. 322
80687 München


  reply	other threads:[~2026-05-14 11:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 13:31 [PATCH v2 0/2] drm/bridge: lt9211: Add drive-strength-microamp DT property Boerge Struempfel
2026-05-13 13:31 ` [PATCH v2 1/2] dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property Boerge Struempfel
2026-05-13 13:41   ` Marek Vasut
2026-05-14 10:56     ` Börge Strümpfel
2026-05-14  5:26   ` sashiko-bot
2026-05-14 10:53     ` Börge Strümpfel
2026-05-13 13:31 ` [PATCH v2 2/2] drm/bridge: lt9211: Add drive-strength-microamp DT property Boerge Struempfel
2026-05-13 13:45   ` Marek Vasut
2026-05-14 11:20     ` Börge Strümpfel [this message]
2026-05-14 12:42       ` Marek Vasut

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=agWuyCxPqwZ4ztVF@DATAMODULBOERGELINUX \
    --to=bstruempfel@data-modul.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marex@denx.de \
    --cc=marex@nabladev.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --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