From patchwork Fri Feb 28 21:05:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1246853 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=DBjW8KwU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 ozlabs.org (Postfix) with ESMTPS id 48Thxd1lWvz9sPk for ; Sat, 29 Feb 2020 08:09:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EEAE4812D1; Fri, 28 Feb 2020 22:07:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DBjW8KwU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DCF7D811FC; Fri, 28 Feb 2020 22:06:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C8969811FC for ; Fri, 28 Feb 2020 22:06:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x844.google.com with SMTP id v25so3116894qto.7 for ; Fri, 28 Feb 2020 13:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qjm2fJqd3nur5S/HqeWbD3ZER0QOhyA6bZ+ISNNH+Ds=; b=DBjW8KwUCVhb10w2yRlAzH/pSvOwcNtVbPKxUL8njRewZpCF4sYeltNUpHzL6jWT0G DnmFwL4/dstFw4+P9t51JFveERS4kK39dnn4AnhDvzi1PBphyZCsgGL+wFYCQo1ec1HL e73Gj8TbuHkUCL8IOZdgYMDoYIScG/qIjbXnT4AFrJsD/Dp0mwHvL4MRI2NaPJZK8nfK p5O9dupZUZVRSquUxz1MhQgYcxni4yIL81Q6p3in0oUUNebKU2OPiHN2+KoDxDdKv3t3 vvgMLx1qvMIaWmqMY0Khk9yZwZ529Hbry2jaGeeSHmUfWYpE/MzHYmhOnrMf1sSX1/Dm OTHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qjm2fJqd3nur5S/HqeWbD3ZER0QOhyA6bZ+ISNNH+Ds=; b=h5P2zjh64luUN/Dp92PsTYfFGXBKs3RkTbte0Rg17ZRoa8dSL6u7ARfpFn6Kp1eV0f YEKWxqKOq+8D0buBvyQVJ+oauz6xE/OGXTQpWtos/ggqssChT2WWQYQ7aWeaxhhNKsZR m3GtqDyxQBpOoD5be0QsX9agFBtMX9qtiqf/8C10+qSktB1Ss4GAUGoFmQxWwrSKTEsK lRuZtTmTfcD+K6u3EIBxqd/JzIrUA1bwdMGrP0oXPDEi/YugzRjS1jk+Q3eWcKPDnP76 hsc9OXiKO3Gc5e5HsiwlCD0+57QOLBf34vnXg2K5VZeYqVL+yoQCRNm2B5nA9JaFC0VR +Wag== X-Gm-Message-State: APjAAAWRVCi5P3Wa0tYHGrUNwPJc0FpvegI6Ymw6UPWacYNkKiT6DqLs 8bXGvnp7/AYLKKnOcudJ0ArGRRrYQSM= X-Google-Smtp-Source: APXvYqyFfrfHN8+XForW+BFGSbaqcUh/HxHnCLyRcu+cIKKkpIASCDcN0PwvxXvdKc5ce0dpUgsNWg== X-Received: by 2002:aed:2047:: with SMTP id 65mr6019228qta.78.1582923989530; Fri, 28 Feb 2020 13:06:29 -0800 (PST) Received: from localhost.localdomain ([75.102.135.197]) by smtp.gmail.com with ESMTPSA id f21sm1509571qtq.16.2020.02.28.13.06.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2020 13:06:28 -0800 (PST) From: Sean Anderson To: u-boot@lists.denx.de Cc: Rick Chen , Bin Meng , Sean Anderson , Simon Glass , Tom Rini Subject: [PATCH v5 18/33] led: gpio: Default to using node name if label is absent Date: Fri, 28 Feb 2020 16:05:36 -0500 Message-Id: <20200228210552.615672-19-seanga2@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200228210552.615672-1-seanga2@gmail.com> References: <20200228210552.615672-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean This more closely mirrors Linux's behaviour, and will make it easier to transition to using function+color in the future. Signed-off-by: Sean Anderson --- Changes in v5: - New drivers/led/led_gpio.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c index af6b8245c9..643d5e2116 100644 --- a/drivers/led/led_gpio.c +++ b/drivers/led/led_gpio.c @@ -98,11 +98,8 @@ static int led_gpio_bind(struct udevice *parent) const char *label; label = ofnode_read_string(node, "label"); - if (!label) { - debug("%s: node %s has no label\n", __func__, - ofnode_get_name(node)); - return -EINVAL; - } + if (!label) + label = ofnode_get_name(node); ret = device_bind_driver_to_node(parent, "gpio_led", ofnode_get_name(node), node, &dev);