Message ID | 20230601162404.220488-5-sjg@chromium.org |
---|---|
State | Accepted |
Commit | 11c341b118a236423a294a7d62f71bf33e20aea3 |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CC/K87Au; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QXBMK3Yc6z20Py for <incoming@patchwork.ozlabs.org>; Fri, 2 Jun 2023 02:25:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A7AE38636B; Thu, 1 Jun 2023 18:24:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CC/K87Au"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 14BAE86354; Thu, 1 Jun 2023 18:24:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 134DB86347 for <u-boot@lists.denx.de>; Thu, 1 Jun 2023 18:24:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-33b1da9a8acso4143315ab.3 for <u-boot@lists.denx.de>; Thu, 01 Jun 2023 09:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1685636670; x=1688228670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VUE4b2cfub6CYabePqkHrY+HhlHmeXntUp9dJwzLpxE=; b=CC/K87AuiatOLf01sXpRL+GaJJ/3rstNdYSXW1iDXF6yPQh2BKRVcaINHN1lNGbWpt 0qHu06vOrawKA3V73gLiUrwoXi4HtEa9Zp5Y8gdySSf/7FsXgPZSrZDZOwlm1z5HPGnQ 5qgi+GyF75StmeSVk1QDCk593lN+cNRE4vHq8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685636670; x=1688228670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VUE4b2cfub6CYabePqkHrY+HhlHmeXntUp9dJwzLpxE=; b=BXN2weZOTT+7P8mZcqTRsgvp7QDGjI2/vYJ794T1qjaau3vdZylxSlKHEhkE6DNjmX 6eD5GuNoKjsR6BeQrFMI/VdvCgiGQGEuOyuwE/5pUaT35BkHViOYaJncucRI1ZZA7pUv YZl2oHV6ajeFZQyOx2WReTYkBBXxKOYGBXK3hR29HuQOtbXj05pXajbLeWgvU/aZd/yJ JeEUbCTTYShmr1ZxRXqHo/Z3RLiRimLxmNY9mSiC5DqR1Vy7JuHPA9pI0wLpwxaV3dBI Hwl2VoGoTtDXajMc638WO7NcZH2N7SAInH1SnrWJe9eAvwBaS+W+N9YZyMgQkQMRAeBX 4ytg== X-Gm-Message-State: AC+VfDxtxsVhwJd3p6KF6l/UOnuIDybdriCrinLNVUB0pt74rWkIuXII tGLXE9PEnAxkT88Fa6McjGunjfwfQptDb7l9to4= X-Google-Smtp-Source: ACHHUZ74RIOAubfFR3aCzugDsZYiWaXtl82xZ2iQw63lIDGbSIdBaSHW3vVxSYq7fIR3OuPx5B+5ew== X-Received: by 2002:a92:db51:0:b0:330:f7b3:ead with SMTP id w17-20020a92db51000000b00330f7b30eadmr6535494ilq.12.1685636670601; Thu, 01 Jun 2023 09:24:30 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id l1-20020a922901000000b0033a6e7ee4e3sm3862098ilg.1.2023.06.01.09.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 09:24:30 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>, Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>, Heiko Schocher <hs@denx.de> Subject: [PATCH 06/40] gpio: Avoid using an invalid ofnode Date: Thu, 1 Jun 2023 10:22:30 -0600 Message-ID: <20230601162404.220488-5-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog In-Reply-To: <20230601162404.220488-1-sjg@chromium.org> References: <20230601162404.220488-1-sjg@chromium.org> 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 <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean |
Series |
expo: Add an initial configuration editor
|
expand
|
Hello Simon, On 01.06.23 18:22, Simon Glass wrote: > Devices do not necessarily have nodes attached to them, since they can be > created from platdata. In SPL a devicetree may in fact not exist at all. > > Check the node before using it. This avoids failure when OF_CHECKS is > enabled. > > Signed-off-by: Simon Glass <sjg@chromium.org> > Fixes: 5fc7cf8c8e2 ("gpio: add gpio-hog support") > --- > > drivers/gpio/gpio-uclass.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks! Reviewed-by: Heiko Schocher <hs@denx.de> bye, Heiko
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index 712119c3415b..31027f3d9902 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -1474,7 +1474,7 @@ static int gpio_post_bind(struct udevice *dev) } #endif - if (CONFIG_IS_ENABLED(GPIO_HOG)) { + if (CONFIG_IS_ENABLED(GPIO_HOG) && dev_has_ofnode(dev)) { struct udevice *child; ofnode node;
Devices do not necessarily have nodes attached to them, since they can be created from platdata. In SPL a devicetree may in fact not exist at all. Check the node before using it. This avoids failure when OF_CHECKS is enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 5fc7cf8c8e2 ("gpio: add gpio-hog support") --- drivers/gpio/gpio-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)