From patchwork Thu Mar 5 18:53:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1249823 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=asqkCvN3; dkim-atps=neutral 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48YKgK151lz9sPF for ; Fri, 6 Mar 2020 05:54:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 687F8812B0; Thu, 5 Mar 2020 19:54:05 +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="asqkCvN3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CDB11812B0; Thu, 5 Mar 2020 19:53:53 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) (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 DBAEC81295 for ; Thu, 5 Mar 2020 19:53:49 +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-qv1-xf42.google.com with SMTP id r8so2901746qvs.12 for ; Thu, 05 Mar 2020 10:53:49 -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=AogtJKZ/At8EiOAbumP7F4eZkmdhEegb7J/MZYcgcoI=; b=asqkCvN3ab+NXVsIEZJfXLY814JFqcu3BWQo4fNefnApstg8JhtWt/rbFLXgJdcAAm Jbj+9KN/oOGKP2YMpkdA5DCotDJaIvGAlVKhcWTGQpChYxfHh8uCyGAxfxJiQie60oqW ICSzg9yKJsmIxc6fxIwFUFi2TL4vsNfyYBwvZKkldm8GYNJDTjChQihvaqgfNl7ylUCM RhWa3WMQJD+zaCl9TrQ3seE7v6+NBy9pUJfCsnE0rNgyfzxUl9JEGGPrCEBLFnpFQXrk 4Xm23dQgWUMnF6CKkMS0HGJavtAhuVxDFkbnnx+5a608XgqyTJB5McNbMj+BozeXtUp5 nHcQ== 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=AogtJKZ/At8EiOAbumP7F4eZkmdhEegb7J/MZYcgcoI=; b=JSUFWFpixtrbVrVVCDCcz1Zxj9l9+a0DGbfAwBE3JQ5TA9dfhfzxRDvj1EaB2q9v/7 oeap/JmKAop3mud000DkdK5RnbMQS65ueP29mCsoqsMPTZFQQsIydrN3vm/PLlRl/pyX 0t+fDKb/AxTTj3YX7SX5ePm+gvhLr1b4HC814TEhaDe38wgjHZK3EcoWEvdwCP+Ksr6G cLHTe136YHRSetVS3Uyb9ip4Kvplvj28cg+HX4OjRmlyIuOwfz3eEuAxmDxXhHuqpYlJ /S79yVxdvPBTVL/8n5o1w+7o4neI78+9Oxw035eI4iO3pceObE7nsOlwjpCkoH6Qsgwv NQPA== X-Gm-Message-State: ANhLgQ3HpqS0VtikWM2g5FylvER3mtpk0Y5OdxOWKMrFs0eIsiit+Rmq JB95PxEggCb5IhNv6kJ99a+fak3N X-Google-Smtp-Source: ADFU+vu5nTSl/BBsR+/iIm7oavPL8CQNcYmWWRJ5kcZ34abMP+/tx9hV8Eu8MwSWD18CKOTxtB8Fcw== X-Received: by 2002:a0c:db0d:: with SMTP id d13mr113288qvk.117.1583434428328; Thu, 05 Mar 2020 10:53:48 -0800 (PST) Received: from localhost.localdomain ([75.102.135.197]) by smtp.gmail.com with ESMTPSA id o16sm16263379qke.35.2020.03.05.10.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 10:53:47 -0800 (PST) From: Sean Anderson To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Sean Anderson Subject: [PATCH v1 6/8] led: gpio: Default to using node name if label is absent Date: Thu, 5 Mar 2020 13:53:26 -0500 Message-Id: <20200305185328.951011-7-seanga2@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200305185328.951011-1-seanga2@gmail.com> References: <20200305185328.951011-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 --- This patch was previously submitted as part of https://patchwork.ozlabs.org/project/uboot/list/?series=161576 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);