Re: [PATCH v2 2/2] drm/bridge: lt9211: Add drive-strength-microamp DT property
From: Börge Strümpfel
Date: Thu May 14 2026 - 07:22:24 EST
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",
> > + µamp);
>
> 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