From patchwork Fri Apr 22 13:15:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1620832 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=mbxK9nvI; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=W+Wf7bgu; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KlFKp1yTVz9s0w for ; Fri, 22 Apr 2022 23:16:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1B56E83D85; Fri, 22 Apr 2022 15:16:23 +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=1650633383; bh=5Fr/jqkk7TSLZxGtB8Ypvrl+DXYneZaC9O0QX2SyDx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mbxK9nvIzkYhvl9TZ8Pqj/6HJNwauSk56+O/e21s/UotpD7LYRwPJ1cS4rNT2x9vl i8OGDNT6Fpg45A8uhipOlz21dcfUC3C37Mj+oMWgJy71sRX9Fatyo4bbckm3IvmEz4 XlPQ9uI2Uij+g5+WhM+ttJyBPtwqF9BYbc5tacsQekRakCSfX06Jom3ldHGj/qDa4x gpOH/4cgp9BWWemD8Dx44fJM7vl0vo8qeLrJydoYy2+73VcOrkXUKj44Jg/0/m6MnK s1UFecL0w7djQAh9d5+uJI39/Ciawckbj/tImPn+xI6MTLGQsrQjdYbx0gr5OdfFMe aSmctTB3wZ0cg== 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 DC5EC83D62; 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=1650633368; bh=5Fr/jqkk7TSLZxGtB8Ypvrl+DXYneZaC9O0QX2SyDx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W+Wf7bguD3cYuxqrvVLu7fBTXKVZXPz04/iS7YfiGzzwVTXno4fgUigtNqejeqtSA 7Vcmu90V6AqDKHdfRVbcSCF/LRYvPnv9wsOVtK7HQOB7euZvKzLfoyAHf+uUTs8z0h pKolO13DIBC+3ecg1vORySAGFqcTu4Lf/KnCbK9M8uCdHbgFWxW/FL6PAexwUkIEPB WjfhargG0sE/MogX6a/bPS3r30YbV+6nykLPO6x9Cv9efVVprZfZtW3IwmYC5fu1Be VRxVQrUDUVieCXWUiVzywoqHuqTptSXqMVQ+C0sFv1Sl+Zl9IaDTR+Za54smXvwMWd WH599VqJUDSOQ== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Patrice Chotard , Patrick Delaunay , Sean Anderson , Simon Glass , Steven Lawrance Subject: [PATCH 3/3] led: gpio: Check device compatible string to determine the top level node Date: Fri, 22 Apr 2022 15:15:55 +0200 Message-Id: <20220422131555.123598-3-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 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 Since 2d1deaf88ed ("led: gpio: Drop duplicate OF "label" property parsing"), all LED nodes have some sort of label. Use device_is_compatible(..."leds-gpio") to determine whether this is a top-level node, since it is only the top level node which is compatible with "leds-gpio", the GPIO LEDs subnodes are not. Fixes: 2d1deaf88ed ("led: gpio: Drop duplicate OF "label" property parsing") Signed-off-by: Marek Vasut Cc: Patrice Chotard Cc: Patrick Delaunay Cc: Sean Anderson Cc: Simon Glass Cc: Steven Lawrance Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard --- drivers/led/led_gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c index 958dbd31e77..23156907593 100644 --- a/drivers/led/led_gpio.c +++ b/drivers/led/led_gpio.c @@ -57,12 +57,11 @@ static enum led_state_t gpio_led_get_state(struct udevice *dev) static int led_gpio_probe(struct udevice *dev) { - struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev); struct led_gpio_priv *priv = dev_get_priv(dev); int ret; /* Ignore the top-level LED node */ - if (!uc_plat->label) + if (device_is_compatible(dev, "gpio-leds")) return 0; ret = gpio_request_by_name(dev, "gpios", 0, &priv->gpio, GPIOD_IS_OUT);