From: Alexander Dahl <ada@thorsis.com>
To: "andriy.shevchenko@linux.intel.com" <andriy.shevchenko@linux.intel.com>
Cc: Jonathan Brophy <J.Brophy@corkillsystems.co.nz>,
"lee@kernel.org" <lee@kernel.org>,
"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
Pavel Machek <pavel@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 1/1] leds: Unexport of_led_get()
Date: Thu, 11 Dec 2025 13:34:10 +0100 [thread overview]
Message-ID: <20251211-plural-generic-c7e78cd51f9d@thorsis.com> (raw)
In-Reply-To: <aTnsCw8KGVoEiQ34@smile.fi.intel.com>
Hello Andy,
Am Wed, Dec 10, 2025 at 11:54:19PM +0200 schrieb andriy.shevchenko@linux.intel.com:
> On Wed, Dec 10, 2025 at 06:30:06PM +0000, Jonathan Brophy wrote:
> > > Can you elaborate? I think your downstream code (I have no other ideas where you Q came from)
> > > uses some outdated approaches. Try to look at the problem from the level of the existing APIs and
> > > frameworks. We shouldn't really have such an issue (but it might be some special use case, I admit).
> >
> > I'm trying to create a virtual led driver but with the removal of
> > of_led_get() im struggling to find a way to make it work.
>
> Still it's unclear to me what it means and how the code look like.
> Perhaps you need to send some patches for the discussion (maybe as
> RFC if you think they are not upstream ready).
I guess it is about the patch series Jonathan already sent?
https://lore.kernel.org/linux-leds/20251019092331.49531-1-professorjonny98@gmail.com/T/#u
Greets
Alex
>
> > I investigated alternative approaches to avoid of_led_get() dependency, including:
> >
> > Direct class_find_device(led_class, ...) calls - Failed because led_class is
> > not exported (static in led-class.c)
>
> > bus_find_device_by_fwnode() - Failed because LED devices are class devices,
> > not bus devices
>
> > Manual iteration via class_dev_iter_init() - Failed because I cannot obtain
> > the led_class pointer
> >
> > of_led_get() appears to be the only viable solution because:
> >
> > It's the only exported function with access to the non-exported leds_class
> > It handles GPIO LED matching quirks (parent node vs child node)
> > It provides proper reference counting via led_put()
> >
> > Should led_class be exported, or is there a planned fwnode-based alternative
> > to of_led_get?
>
> You can introduce it as a precursor to your driver. But OF centric variant
> gone for good, we use fwnode in a new code.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
>
next prev parent reply other threads:[~2025-12-11 12:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-10 10:43 [PATCH v1 1/1] leds: Unexport of_led_get() Jonathan Brophy
2025-12-10 12:33 ` andriy.shevchenko
2025-12-10 18:30 ` Jonathan Brophy
2025-12-10 21:54 ` andriy.shevchenko
2025-12-11 0:49 ` Jonathan Brophy
2025-12-11 13:51 ` andriy.shevchenko
2025-12-11 12:34 ` Alexander Dahl [this message]
2025-12-11 13:46 ` andriy.shevchenko
-- strict thread matches above, loose matches on Subject: below --
2025-06-30 9:26 Andy Shevchenko
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=20251211-plural-generic-c7e78cd51f9d@thorsis.com \
--to=ada@thorsis.com \
--cc=J.Brophy@corkillsystems.co.nz \
--cc=andriy.shevchenko@linux.intel.com \
--cc=lee@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