public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "andriy.shevchenko@linux.intel.com" <andriy.shevchenko@linux.intel.com>
To: Jonathan Brophy <J.Brophy@corkillsystems.co.nz>
Cc: "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: Wed, 10 Dec 2025 23:54:19 +0200	[thread overview]
Message-ID: <aTnsCw8KGVoEiQ34@smile.fi.intel.com> (raw)
In-Reply-To: <SYAPR01MB2863FAF8B39141E2FC402D21B2A0A@SYAPR01MB2863.ausprd01.prod.outlook.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 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



  reply	other threads:[~2025-12-10 21:54 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 [this message]
2025-12-11  0:49       ` Jonathan Brophy
2025-12-11 13:51         ` andriy.shevchenko
2025-12-11 12:34       ` Alexander Dahl
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=aTnsCw8KGVoEiQ34@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=J.Brophy@corkillsystems.co.nz \
    --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