From nobody Tue Nov 24 11:51:52 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.160.73.65 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795367199; b=HbzTT4tNXbhS0FrWGABBu8LLpydqaWWg6NxE4VHWwb2vW7/zvbtbBDtgI4AFxCBQXtbJ YwEUVNsKhM2zn+DV77cVIzmHX43ftEtkPSxU9cfF+lTQs8VkPkkmhJZ1dKIOlkI+7/SD/ A9hdsCqfTBOcE4xC/rss5zmjYOn04KbZHe5CtmUelWYDGxOworuvwe9RkMSaSvhymAd8/ 38+XKbqj3tbRs1a7Nvde0KeFNkD2FRfH9UHJiVaBAH7DX5KBqXmZc6FNmujti9tlREWo9 Z9rOZj5FG2+SOX4GeEaT3b0b1o58mahZlJbzXfv0T9ZCaGM+xs0QDHVlEuiepEf2lzA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795367199; h=DMARC-Filter:Received:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=kVyM5OtJ62yR9aZQC5kbMHpd8CkF8MTSGTtuKZsQ0qc=; b=Yzt/rCp2bU+zTAMPFqsu8SF1ASBtligzYxrMm585qHchTjl67Fl1YDVquJDH06xVe5g9 ToANXqJK0NTBtRmfrviwGNckH5u8dsn7BYUpNeUdvJlpV02LHiXDaQg/xwxjOnTgrRlSe WshQ0Db2buBeBFbXbI0ytfiF+6+foVJ1Leg7z9RkHwuZKME9G6Lr6UmrQ9Cfb9oaZ3bxV NNOibL3wsZvCU5ErFFc/REWiAsMlbPHWsIGtExSR6h9TqNPFaJhc6S+gNWU0ZiKfv9BDe TWlzjyZtRomNHZBVQ01Hg992XgUuNkGhPe5Tyc0tdyBCTMMH5FKlJEkTGRuvFh31E4w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=blala.de; spf=pass smtp.mailfrom=blala.de; arc=none smtp.remote-ip=213.160.73.65 Received: from vs81.iboxed.net (vs10.datenmanufaktur-hosting.net [213.160.73.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B892A606A320; Sun, 22 Nov 2026 17:06:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B892A606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blala.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=blala.de Received: from blala.de (localhost [127.0.0.1]) by vs81.iboxed.net (8.18.1/8.18.1/Debian-6) with ESMTP id 6AMH6IKW031729; Sun, 22 Nov 2026 17:06:18 GMT Received: (from akurz@localhost) by blala.de (8.18.1/8.18.1/Submit) id 6AMH6ITw031728; Sun, 22 Nov 2026 17:06:18 GMT From: Alexander Kurz To: Lee Jones , Pavel Machek , Griffin Kroah-Hartman Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Bjorn Helgaas , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Kurz Subject: [PATCH v3 1/2] leds: mc13783: Use unified device property API Date: Sun, 22 Nov 2026 17:06:14 +0000 Message-ID: <20261122170615.31710-2-akurz@blala.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261122170615.31710-1-akurz@blala.de> References: <20261122170615.31710-1-akurz@blala.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace OF-specific API calls with the unified device property variants and drop the CONFIG_OF-guard around mc13xxx_led_probe_dt() since all used implementations should be safe for !CONFIG_OF compilation now. Signed-off-by: Alexander Kurz --- drivers/leds/leds-mc13783.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c index 19c1b51475db..0882c7f6b649 100644 --- a/drivers/leds/leds-mc13783.c +++ b/drivers/leds/leds-mc13783.c @@ -16,8 +16,8 @@ #include #include #include +#include #include -#include #include =20 struct mc13xxx_led_devtype { @@ -108,13 +108,12 @@ static int mc13xxx_led_set(struct led_classdev *led_c= dev, value << shift); } =20 -#ifdef CONFIG_OF static struct mc13xxx_leds_platform_data __init *mc13xxx_led_probe_dt( struct platform_device *pdev) { struct mc13xxx_leds *leds =3D platform_get_drvdata(pdev); struct mc13xxx_leds_platform_data *pdata; - struct device_node *child; + struct fwnode_handle *child; struct device *dev =3D &pdev->dev; int i =3D 0, ret =3D -ENODATA; =20 @@ -122,34 +121,34 @@ static struct mc13xxx_leds_platform_data __init *mc13= xxx_led_probe_dt( if (!pdata) return ERR_PTR(-ENOMEM); =20 - struct device_node *parent __free(device_node) =3D - of_get_child_by_name(dev_of_node(dev->parent), "leds"); + struct fwnode_handle *parent __free(fwnode_handle) =3D + device_get_named_child_node(dev->parent, "leds"); if (!parent) return ERR_PTR(-ENODATA); =20 - ret =3D of_property_read_u32_array(parent, "led-control", + ret =3D fwnode_property_read_u32_array(parent, "led-control", pdata->led_control, leds->devtype->num_regs); if (ret) return ERR_PTR(ret); =20 - pdata->num_leds =3D of_get_available_child_count(parent); + pdata->num_leds =3D fwnode_get_child_node_count(parent); =20 pdata->led =3D devm_kzalloc_objs(dev, *pdata->led, pdata->num_leds); if (!pdata->led) return ERR_PTR(-ENOMEM); =20 - for_each_available_child_of_node(parent, child) { + fwnode_for_each_child_node(parent, child) { const char *str; u32 tmp; =20 - if (of_property_read_u32(child, "reg", &tmp)) + if (fwnode_property_read_u32(child, "reg", &tmp)) continue; pdata->led[i].id =3D leds->devtype->led_min + tmp; =20 - if (!of_property_read_string(child, "label", &str)) + if (!fwnode_property_read_string(child, "label", &str)) pdata->led[i].name =3D 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 =3D str; =20 @@ -162,13 +161,6 @@ static struct mc13xxx_leds_platform_data __init *mc13x= xx_led_probe_dt( =20 return pdata; } -#else -static inline struct mc13xxx_leds_platform_data __init *mc13xxx_led_probe_= dt( - struct platform_device *pdev) -{ - return ERR_PTR(-ENOSYS); -} -#endif =20 static int __init mc13xxx_led_probe(struct platform_device *pdev) { @@ -189,7 +181,7 @@ static int __init mc13xxx_led_probe(struct platform_dev= ice *pdev) leds->master =3D mcdev; platform_set_drvdata(pdev, leds); =20 - if (dev_of_node(dev->parent)) { + if (dev_fwnode(dev->parent)) { pdata =3D mc13xxx_led_probe_dt(pdev); if (IS_ERR(pdata)) return PTR_ERR(pdata); --=20 2.39.5 From nobody Tue Nov 24 11:51:52 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.160.73.65 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795367200; b=qBv1fa78rSzmO7NTSlkRMqY3DocEJTN78W9KgPswPZkUzmqpBlRsAYzA/5tJtH/OHxPY HKRy0s4JAEp9Fgl/luC3EZkyX0JVFnfBvu9ova0XaTIh/lYxP5I/z1VBcMkBc/cXprucd La/o+YOIShLqfwmmSjW+tuAtmhtEdftpgbNNU+eirLt13La95ORqZt8x9n5yJo4LU0q30 lfo/sntlG5fNxQFDveDPvD9c6C1/5dzu2HkDUPM2N2ZcUAF9fFaQ9mgTJ+1v39Slbfxe8 tFni2ognc3k//covP34sd/m/i7s+zGD0cYrjNG4bay3/AMXuwCYQv2irgHyR0sYh0MQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795367200; h=DMARC-Filter:Received:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=xKJU8r8LgWpb+YbX2NKqLQcLCQkJ8708QhgDAlQe+d8=; b=cunmFwgY02Qf+UuJuB4kFPtx7n9Dgv6s4iV4XGMtBKVripO/MIUTKKOntLUN+SWWpr7x a3QAGltw1SApstOVeteHssPMkHNLnRKFuEk4/6IDfeH/gYtnII4JwkXizI9+UUWo8J8FI Q/SEcEliJmmaHY7h3DMXxs/XDlWmQJ+T0PFdI1vM3D8Egu5XFrhLgZI+uhst6RJgOSw0R EvODGhrSMKk70a2Rkeu2LWYFqJxpaxdKV3UJNm1CjnyHxiMM6c5e5ZO+5iUDVTLKOsJWa ZUI34zNake/m6NIm/Ck6tH6BzwKbpIO/tdiAO+TCeu05DOQuFBu3bLhuyNA+EfnfiCw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=blala.de; spf=pass smtp.mailfrom=blala.de; arc=none smtp.remote-ip=213.160.73.65 Received: from vs81.iboxed.net (vs10.datenmanufaktur-hosting.net [213.160.73.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C0A5606A680; Sun, 22 Nov 2026 17:06:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4C0A5606A680 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blala.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=blala.de Received: from blala.de (localhost [127.0.0.1]) by vs81.iboxed.net (8.18.1/8.18.1/Debian-6) with ESMTP id 6AMH6I5V031738; Sun, 22 Nov 2026 17:06:18 GMT Received: (from akurz@localhost) by blala.de (8.18.1/8.18.1/Submit) id 6AMH6Iom031737; Sun, 22 Nov 2026 17:06:18 GMT From: Alexander Kurz To: Lee Jones , Pavel Machek , Griffin Kroah-Hartman Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Bjorn Helgaas , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Kurz Subject: [PATCH v3 2/2] leds: leds-mc13783: enable driver for deferred probe Date: Sun, 22 Nov 2026 17:06:15 +0000 Message-ID: <20261122170615.31710-3-akurz@blala.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261122170615.31710-1-akurz@blala.de> References: <20261122170615.31710-1-akurz@blala.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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_cde= v, value << shift); } =20 -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 =3D platform_get_drvdata(pdev); @@ -162,7 +162,7 @@ static struct mc13xxx_leds_platform_data __init *mc13xx= x_led_probe_dt( return pdata; } =20 -static int __init mc13xxx_led_probe(struct platform_device *pdev) +static int mc13xxx_led_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; struct mc13xxx_leds_platform_data *pdata =3D dev_get_platdata(dev); @@ -288,13 +288,14 @@ static const struct platform_device_id mc13xxx_led_id= _table[] =3D { MODULE_DEVICE_TABLE(platform, mc13xxx_led_id_table); =20 static struct platform_driver mc13xxx_led_driver =3D { + .probe =3D mc13xxx_led_probe, .driver =3D { .name =3D "mc13xxx-led", }, .remove =3D mc13xxx_led_remove, .id_table =3D mc13xxx_led_id_table, }; -module_platform_driver_probe(mc13xxx_led_driver, mc13xxx_led_probe); +module_platform_driver(mc13xxx_led_driver); =20 MODULE_DESCRIPTION("LEDs driver for Freescale MC13XXX PMIC"); MODULE_AUTHOR("Philippe Retornaz "); --=20 2.39.5