From: Daniel Thompson <daniel@riscstar.com>
To: "A. Sverdlin" <alexander.sverdlin@siemens.com>
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
Andrew Davis <afd@ti.com>, Lee Jones <lee@kernel.org>,
Pavel Machek <pavel@kernel.org>,
Daniel Thompson <danielt@kernel.org>,
Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>,
linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org
Subject: Re: [PATCH 1/2] backlight: led_bl: Add devm_led_backlight_register() helper
Date: Mon, 24 Aug 2026 10:17:17 +0100 [thread overview]
Message-ID: <aowMHRSOg82oSBmV@aspen.lan> (raw)
In-Reply-To: <20260817170817.1933046-2-alexander.sverdlin@siemens.com>
On Mon, Aug 17, 2026 at 07:08:14PM +0200, A. Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>
> The led-backlight driver could so far only be instantiated from a
> device-tree node with the "led-backlight" compatible. This makes it
> impossible for a self-contained LED provider (e.g. a hot-pluggable I2C
> LED controller) to expose a backlight interface tied to its own
> lifetime.
>
> Factor the actual backlight registration out of the probe path into a
> shared led_bl_register() helper and export devm_led_backlight_register(),
> which registers a backlight class device driven by a single LED, without
> device tree and bound to the caller's device lifetime. The backlight
> device and the LED sysfs handover are now devres-managed, so the probe
> path shrinks and the explicit .remove callback is no longer needed.
Please can you split this patch into two pieces to make review easier.
One to introduce make the backlight device and LED sysfs handover devre
-managed and the other to introduce devm_led_backlight_register().
> diff --git a/include/linux/led_bl.h b/include/linux/led_bl.h
> new file mode 100644
> index 0000000000000..e38e4d62bf653
> --- /dev/null
> +++ b/include/linux/led_bl.h
> @@ -0,0 +1,20 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _LINUX_LED_BL_H
> +#define _LINUX_LED_BL_H
> +
> +#include <linux/kconfig.h>
> +
> +struct device;
> +struct led_classdev;
> +
> +#if IS_REACHABLE(CONFIG_BACKLIGHT_LED)
> +int devm_led_backlight_register(struct device *dev, struct led_classdev *led);
> +#else
> +static inline int devm_led_backlight_register(struct device *dev,
> + struct led_classdev *led)
> +{
> + return 0;
This should not return success; it has not succeeded in registering a
backlight.
> +}
> +#endif
Daniel.
next prev parent reply other threads:[~2026-08-24 9:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 17:08 [PATCH 0/2] leds: lp8864: Expose a backlight via led_bl helper A. Sverdlin
2026-08-17 17:08 ` [PATCH 1/2] backlight: led_bl: Add devm_led_backlight_register() helper A. Sverdlin
2026-08-24 9:17 ` Daniel Thompson [this message]
2026-08-17 17:08 ` [PATCH 2/2] leds: lp8864: Register a backlight device A. Sverdlin
2026-08-24 9:33 ` Daniel Thompson
2026-08-24 15:39 ` Andrew Davis
2026-08-25 9:15 ` Daniel Thompson
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=aowMHRSOg82oSBmV@aspen.lan \
--to=daniel@riscstar.com \
--cc=afd@ti.com \
--cc=alexander.sverdlin@siemens.com \
--cc=danielt@kernel.org \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingoohan1@gmail.com \
--cc=lee@kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@kernel.org \
/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