From: Alexander Kurz <akurz@blala.de>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
Griffin Kroah-Hartman <griffin@kroah.com>
Cc: "Mariusz Tkaczyk" <mariusz.tkaczyk@linux.intel.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
"Alexander Kurz" <akurz@blala.de>
Subject: [PATCH 1/2] leds: leds-mc13783: use unified device property API
Date: Sat, 21 Nov 2026 07:42:38 +0000 [thread overview]
Message-ID: <20261121074239.8745-1-akurz@blala.de> (raw)
As preparation for a fix regarding deferred probing, replace OF-specific
API calls with the unified device property variants.
Signed-off-by: Alexander Kurz <akurz@blala.de>
---
drivers/leds/leds-mc13783.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
index 19c1b51475db..c3bbbc8ef946 100644
--- a/drivers/leds/leds-mc13783.c
+++ b/drivers/leds/leds-mc13783.c
@@ -16,8 +16,8 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/leds.h>
-#include <linux/of.h>
#include <linux/mfd/mc13xxx.h>
struct mc13xxx_led_devtype {
@@ -114,7 +114,7 @@ static struct mc13xxx_leds_platform_data __init *mc13xxx_led_probe_dt(
{
struct mc13xxx_leds *leds = platform_get_drvdata(pdev);
struct mc13xxx_leds_platform_data *pdata;
- struct device_node *child;
+ struct fwnode_handle *child;
struct device *dev = &pdev->dev;
int i = 0, ret = -ENODATA;
@@ -122,34 +122,34 @@ static struct mc13xxx_leds_platform_data __init *mc13xxx_led_probe_dt(
if (!pdata)
return ERR_PTR(-ENOMEM);
- struct device_node *parent __free(device_node) =
- of_get_child_by_name(dev_of_node(dev->parent), "leds");
+ struct fwnode_handle *parent __free(fwnode_handle) =
+ device_get_named_child_node(dev->parent, "leds");
if (!parent)
return ERR_PTR(-ENODATA);
- ret = of_property_read_u32_array(parent, "led-control",
+ ret = fwnode_property_read_u32_array(parent, "fsl,led-control",
pdata->led_control,
leds->devtype->num_regs);
if (ret)
return ERR_PTR(ret);
- pdata->num_leds = of_get_available_child_count(parent);
+ pdata->num_leds = fwnode_get_child_node_count(parent);
pdata->led = devm_kzalloc_objs(dev, *pdata->led, pdata->num_leds);
if (!pdata->led)
return ERR_PTR(-ENOMEM);
- for_each_available_child_of_node(parent, child) {
+ fwnode_for_each_child_node(parent, child) {
const char *str;
u32 tmp;
- if (of_property_read_u32(child, "reg", &tmp))
+ if (fwnode_property_read_u32(child, "reg", &tmp))
continue;
pdata->led[i].id = leds->devtype->led_min + tmp;
- if (!of_property_read_string(child, "label", &str))
+ if (!fwnode_property_read_string(child, "label", &str))
pdata->led[i].name = str;
- if (!of_property_read_string(child, "linux,default-trigger",
+ if (!fwnode_property_read_string(child, "linux,default-trigger",
&str))
pdata->led[i].default_trigger = str;
--
2.39.5
next reply other threads:[~2026-11-21 7:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 7:42 Alexander Kurz [this message]
2026-11-21 7:42 ` [PATCH 2/2] leds: leds-mc13783: enable driver for deferred probe Alexander Kurz
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=20261121074239.8745-1-akurz@blala.de \
--to=akurz@blala.de \
--cc=bhelgaas@google.com \
--cc=griffin@kroah.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=mariusz.tkaczyk@linux.intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.