[PATCH v3 2/2] leds: leds-mc13783: enable driver for deferred probe
From: Alexander Kurz
Date: Sun Nov 22 2026 - 12:06:48 EST
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@xxxxxxxx>
---
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 0882c7f6b649..538f5794410a 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);
@@ -162,7 +162,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);
@@ -288,13 +288,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@xxxxxxx>");
--
2.39.5