Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB5C1C433F5 for ; Fri, 22 Apr 2022 13:16:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 86E9F83D5B; Fri, 22 Apr 2022 15:16:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1650633372; bh=ayKBD29lsll5CM/0V2Ho4i57TjFcmx22RWzfnXSJktY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qpICm5lQZ3Z4VztMBH7QhDR4j95xFcK+KlOOT7DrEl1T1VRePy14WHoqBBQlr1ArM BWJBJiiCx/6omwqn+zNjPPhq3swYhMOnssW0VAP+0j3sSgftNk9CEsPbJZxXGVrnAq vyYXd2HNdepE4R1aK90ola8PiM3grJeIGC+evJeg8o/85hGBdMp9RrNnx4NFQvGGsT nJE673OZfZLvQnFqPtx2QqfkxD6n/F7oqqgdbJwmFS6akYeIBKcHtOgYHyakcrKF53 fJGMt4xvEI9usQuAuX4VqgFaXKmfwjrL+a1/ftkVbNz0Sx/5eyMHsVxOV9ELzQQhtP K0+Wl5IAjcRMQ== Received: from tr.lan (ip-86-49-12-201.net.upcbroadband.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 60F1883D57; Fri, 22 Apr 2022 15:16:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1650633367; bh=ayKBD29lsll5CM/0V2Ho4i57TjFcmx22RWzfnXSJktY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U/Ul+QeZLRhWxNtO34WrxxxBpBRzbnA/6avHQGrQjz5msdgQXGX81qSqBPrngczwi mwdSrkSIwZVIZWgYhHwWFQfD5wD4rAKS3d3yCx11GEojfX130wgtrZkmphbmgdd5BP JkcZHYUofQH3VKAcrmDn5gbDfKt8z0F7nlo+eiZUgC8O6jMsT1YC1JcMRxCN9f9u2b s5R9KeWWqgJ+pJsO1DIezcEXWh8a8xTHfiXBBcSz5P39/ShTxzhi1Kb4BLM4s8t9Il Wa3WWFNdsESCSyH+cgNBvA9vMpWAgBys0DwWytRdIYMIBeJLVg5cShgZyybG7g+Di4 P2cVj82KQLzMw== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Patrice Chotard , Patrick Delaunay , Sean Anderson , Simon Glass , Steven Lawrance Subject: [PATCH 2/3] led: Mark device instance with DM_FLAG_PROBE_AFTER_BIND Date: Fri, 22 Apr 2022 15:15:54 +0200 Message-Id: <20220422131555.123598-2-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220422131555.123598-1-marex@denx.de> References: <20220422131555.123598-1-marex@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Calling device_probe() from uclass .post_bind() callback has all kinds of odd side-effects, e.g. device instances not being available just yet. Make use of the DM_FLAG_PROBE_AFTER_BIND instead, mark device instances which need to be probe()d in order to configure the LED default state with this flag and let the DM core do the device_probe() at the right time instead. Fixes: 72675b063b6 ("led: Configure LED default-state on boot") Signed-off-by: Marek Vasut Cc: Patrice Chotard Cc: Patrick Delaunay Cc: Sean Anderson Cc: Simon Glass Cc: Steven Lawrance --- drivers/led/led-uclass.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c index 5d7bf40896b..2ce72933b6c 100644 --- a/drivers/led/led-uclass.c +++ b/drivers/led/led-uclass.c @@ -98,7 +98,9 @@ static int led_post_bind(struct udevice *dev) * In case the LED has default-state DT property, trigger * probe() to configure its default state during startup. */ - return device_probe(dev); + dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND); + + return 0; } static int led_post_probe(struct udevice *dev) -- 2.35.1