From: Alexander Kurz <akurz@blala.de>
To: linux-leds@vger.kernel.org
Cc: "Lee Jones" <lee@kernel.org>, "Pavel Machek" <pavel@kernel.org>,
"Griffin Kroah-Hartman" <griffin@kroah.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
linux-kernel@vger.kernel.org, "Alexander Kurz" <akurz@blala.de>
Subject: [PATCH v4 2/2] leds: leds-mc13783: Enable driver for deferred probe
Date: Fri, 27 Nov 2026 20:16:26 +0000 [thread overview]
Message-ID: <20261127201626.26970-3-akurz@blala.de> (raw)
In-Reply-To: <20261127201626.26970-1-akurz@blala.de>
The probe order between mfd and leds has been changed with commit
78efa53e715e ("leds: Init leds class earlier") so that mc13xxx-led
driver was not registered any more due to the missing mfd instance.
Use module_platform_driver() to replace module_platform_driver_probe().
The former utilizes platform_driver_register(), which allows the driver
to defer probing when it doesn't acquire the necessary resources from
the mfd device due to probe order.
Fixes: 78efa53e715e ("leds: Init leds class earlier")
Signed-off-by: Alexander Kurz <akurz@blala.de>
---
drivers/leds/leds-mc13783.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
index 1c4175fe10fa..e2a8f59bef68 100644
--- a/drivers/leds/leds-mc13783.c
+++ b/drivers/leds/leds-mc13783.c
@@ -108,7 +108,7 @@ static int mc13xxx_led_set(struct led_classdev *led_cdev,
value << shift);
}
-static struct mc13xxx_leds_platform_data __init *mc13xxx_led_probe_dt(
+static struct mc13xxx_leds_platform_data *mc13xxx_led_probe_dt(
struct platform_device *pdev)
{
struct mc13xxx_leds *leds = platform_get_drvdata(pdev);
@@ -163,7 +163,7 @@ static struct mc13xxx_leds_platform_data __init *mc13xxx_led_probe_dt(
return pdata;
}
-static int __init mc13xxx_led_probe(struct platform_device *pdev)
+static int mc13xxx_led_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct mc13xxx_leds_platform_data *pdata = dev_get_platdata(dev);
@@ -290,13 +290,14 @@ static const struct platform_device_id mc13xxx_led_id_table[] = {
MODULE_DEVICE_TABLE(platform, mc13xxx_led_id_table);
static struct platform_driver mc13xxx_led_driver = {
+ .probe = mc13xxx_led_probe,
.driver = {
.name = "mc13xxx-led",
},
.remove = mc13xxx_led_remove,
.id_table = mc13xxx_led_id_table,
};
-module_platform_driver_probe(mc13xxx_led_driver, mc13xxx_led_probe);
+module_platform_driver(mc13xxx_led_driver);
MODULE_DESCRIPTION("LEDs driver for Freescale MC13XXX PMIC");
MODULE_AUTHOR("Philippe Retornaz <philippe.retornaz@epfl.ch>");
--
2.39.5
prev parent reply other threads:[~2026-11-27 20:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 20:16 [PATCH v4 0/2] Modernize and fix mc13xxx-led driver Alexander Kurz
2026-11-27 20:16 ` [PATCH v4 1/2] leds: mc13783: Use unified device property API Alexander Kurz
2026-11-27 20:16 ` Alexander Kurz [this message]
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=20261127201626.26970-3-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=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
all inboxes | Powered by JetHome®