From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 593B7606A32C for ; Fri, 4 Dec 2026 06:27:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hKLO2Gyz Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF0291127D4; Fri, 4 Dec 2026 06:26:56 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 20BC310E198 for ; Fri, 4 Dec 2026 06:26:33 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 4B1F860DD1; Fri, 4 Dec 2026 06:26:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E77721F000C2; Fri, 4 Dec 2026 06:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796365592; bh=NJm09w/M+9pmVmARFAgHOzUIkGa17tLaHVcd9M277II=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=hKLO2GyzmsmalAw7nVHKiGGRGIM7LZdpmj+kWDQ4/J6h8XlBenJ8Ux6HCc360zVLv Bl0omWwEpqaoJqoTDW8AUquM5I0RNfffyk2P/6R7KqTg9j5B0ox8ieA3mWiVvPiPUU dO/qvf/5ITJidxMjp3HEIkvOmeIQ/YFYwKhJ0OgpMEvAUU2BnWRPSsmhdOOKOgDF8I VFqWCj+go9tXJA2CN89khcBVuU4XKMs0hMVLYMw6OG02pDw6haPmACAwuN7oS5W6xM iK1pGMQuDJzARoF0NdjIoVl2fMdnYiYc9iE0i5PM3NETt+XHxd7h0ff9AVkFH5xNdE ac+q1WKipw6yA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4] video: backlight: lm3533: Support getting LED sources from DT To: "Svyatoslav Ryhel" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261204061228.29205-1-clamor95@gmail.com> References: <20261204061228.29205-1-clamor95@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 06:26:31 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] backlight: lm3533: lm3533_bl_setup() queries led-sources on wrong device - [Low] backlight: lm3533: lm3533_bl_setup() prints u32 HVLED index with %d -- commit d4f5b0f01b1e3f893ac282d558f208f8c7f1bc60 Author: Svyatoslav Ryhel video: backlight: lm3533: Support getting LED sources from DT This commit reads the led-sources device tree property in lm3533_bl_setup() to configure LM3533_REG_OUTPUT_CONF1 for the backlight control bank. > diff --git a/drivers/video/backlight/lm3533_bl.c b/drivers/video/backligh= t/lm3533_bl.c > index fd6e7f4f1f61c..2d9558a4642b9 100644 > --- a/drivers/video/backlight/lm3533_bl.c > +++ b/drivers/video/backlight/lm3533_bl.c [ ... ] > @@ -235,7 +237,12 @@ static const struct attribute_group *lm3533_bl_attri= bute_groups[] =3D { > =20 > static int lm3533_bl_setup(struct lm3533_bl *bl) > { > + struct device *dev =3D bl->cb.dev; > int ctrlbank =3D lm3533_bl_get_ctrlbank_id(bl); > + u32 led_strings[LM3533_HVCTRLBANK_COUNT] =3D { }; > + u32 output_cfg_val =3D 0; > + u32 output_cfg_mask =3D 0; > + int num_leds; > int ret; > =20 > ret =3D regmap_assign_bits(bl->regmap, LM3533_REG_CTRLBANK_AB_BCONF, > @@ -243,6 +250,42 @@ static int lm3533_bl_setup(struct lm3533_bl *bl) > if (ret) > return ret; > =20 > + /* > + * If led-sources property is not set then either this Control Bank uses > + * its default HVLED or is not linked to any HVLED at all. > + */ > + num_leds =3D device_property_count_u32(dev, "led-sources"); > + if (num_leds > LM3533_HVCTRLBANK_COUNT) > + return dev_err_probe(dev, -EINVAL, > + "number of LED sources %d exceeds maximum %d\n", > + num_leds, LM3533_HVCTRLBANK_COUNT); > + > + if (num_leds < 0) > + num_leds =3D 0; [Severity: High] Can device_property_count_u32() ever find led-sources on bl->cb.dev? lm3533_bl_probe() sets bl->cb.dev to &bl->bd->dev, the backlight class device. backlight_device_register() only sets dev.parent and leaves of_node and fwnode NULL, while the MFD child DT node is attached to &pdev->dev. Because device_property_count_u32() does not consult dev->parent, it always returns -EINVAL and the num_leds < 0 check silently turns that into 0, so LM3533_REG_OUTPUT_CONF1 is never updated from DT. dev_err_probe() also gets the backlight class device instead of &pdev->dev. Passing &pdev->dev to lm3533_bl_setup() (or using bl->cb.dev->parent) would query the platform device that owns the DT node. [ ... ] > + for (int i =3D 0; i < num_leds; i++) { > + if (led_strings[i] >=3D LM3533_HVCTRLBANK_COUNT) > + return dev_err_probe(dev, -EINVAL, > + "HVLED index exceeds maximum 1: %d\n", > + led_strings[i]); [Severity: Low] Should this format specifier be %u instead of %d? led_strings[i] is a u32, so an invalid DT value with bit 31 set would be logged as a negative number. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204061228.2920= 5-1-clamor95@gmail.com?part=3D1