Re: [PATCH v2 2/2] drm/bridge: lt9211: Add drive-strength-microamp DT property
From: Marek Vasut
Date: Wed May 13 2026 - 13:52:23 EST
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.
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.
+ 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;
}