From patchwork Thu Sep 15 20:06:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 606203 Delivered-To: patch@linaro.org Received: by 2002:ab3:1c02:0:b0:1e7:4ce8:c350 with SMTP id u2csp530825lth; Thu, 15 Sep 2022 13:06:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5dJutjolKljbtBXeIaZ1uv+HdKzM0WvEcvRXpjJYKpPgjOGCZuS2Exk5N8xa0aHIEa6Vwn X-Received: by 2002:a17:907:60d6:b0:77d:8aed:cf86 with SMTP id hv22-20020a17090760d600b0077d8aedcf86mr1091991ejc.43.1663272418728; Thu, 15 Sep 2022 13:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663272418; cv=none; d=google.com; s=arc-20160816; b=X0KJibU6AXOOcEy58p3219CeLi0GJfcBEbaMOCCHhWCP6ozYVUP8R5GR3UaAgrYcse /a7D1VCUKr2zD7bWVboubopJQ1/94WTDlQQ15ZvHyTZAb7ePSVpjM7QnqNYZ5MDFImwn DPAdrR0xCe2AJikM05TSAhfeDIfuL03r1ZbGmoQ/j2sTpp003TE64TTqyzU6Rt0nq6yC JjEibAFEnNKdsbllQDlDyXcxnmBWPRKertny52u/DhMNVQb99Yx5JLmFdpr5+KDWWcxf TkhnTmwe+qE+ghMwTcQg1HdGmSnsxTzJFqJ5ftQO2F1w4EOFjHdopX2TrHHdne73v0cf tbUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=vycmJ4KaZAk7CzlOuVCprBT5/i/n7HJryZHYZXyoNN0=; b=o1PfzXXX2Ys7GLioZY7lJVyj95W+hC9gY54uoSJ2UlATXOMmQBml9chg9adoyVHKu8 k9lC9+aBTVZmWwyNdMdgDb7zNa9M1PjvPxWziqG6O5MDlI6rptaJpVZJg4BFFEAbtd6G izwuyPO2vQszh1uE+XV95/lnLqH/KbjFYQai1HEKGLIXjA6rZ7WBAtgiMY9ElQi1RbLu 7TSpsP83u99A9xvJyJl8xKz3fzzf4JP3Q3NU7FvB210s4vPXFPwcH2oulmUrstlQlwzr O2nfO5m04tXow55nDXu2XpRyR11X2mFyd64LIpQjDN2vhuX+d2t4Gl3ab/ZIisWvGzZG VY7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="adNAW5/T"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id t19-20020a056402525300b004488842d88esi324929edd.13.2022.09.15.13.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Sep 2022 13:06:58 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="adNAW5/T"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CBF3F84A7E; Thu, 15 Sep 2022 22:06:54 +0200 (CEST) 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="adNAW5/T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 924C284ACA; Thu, 15 Sep 2022 22:06:53 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (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 12D8283FB5 for ; Thu, 15 Sep 2022 22:06:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zajec5@gmail.com Received: by mail-ej1-x635.google.com with SMTP id dv25so44523442ejb.12 for ; Thu, 15 Sep 2022 13:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=vycmJ4KaZAk7CzlOuVCprBT5/i/n7HJryZHYZXyoNN0=; b=adNAW5/TlO/J8iQyzUdXEzXa1JMG9pFDJXH/9iQ2WhCMDJYjaguJVelnsuKv1fuOOX kRIBY/+EAaQ65G+ZO2mPbt5KoNjJ6Xv7hOdD2Hal0o+1Aa6oNiRgMYVq4/1n4WRCjoO+ hnnsaSu4zExf0cko2bHrZsGJRE+HQnHhFcRomprYMQ6GdrA6m/LMeSpOb66MF1uTcHIh dGONwK4CmCZZZOnxQPoqANcBFnxCaJNuyTC6AR/kUVpfI6MuxlCOJ8hfQHK1KGYngmC/ bnZdc1Fri9Wpr0N7JfLHh3kyPTeFYQrdSjvRZJo3c6NvN+3BwzaDtD+HSRaKq2eRx8TI merA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=vycmJ4KaZAk7CzlOuVCprBT5/i/n7HJryZHYZXyoNN0=; b=yE4OPyHvPhtc8+DBO54PlE8ey04HJJgtugFgjygfvZ08H36zC8Yie7IMqx2IKV4Lh9 ZBYSh8w8MTWnPf4d70Cu+7iQjuCGRAeUph1MtqRKp3tKOOvVFPMpWEHtTTOd+mKZ24vc paQfpRb9zVxXvoX3UnQAA/kYe2n/C/gGZTbTJQuFydh0bpP3NPZXP1B7+6SRhh8VXCbV FqkVWykf4ZYmEyLjoEwrv0VIJ7zReEk1wq6ZaJr+sZBK3Tc9t0ehHgLUF6JBGbe10uoR kvh4esnY4bhFEaCBhT9cUhla3moz2foPBzk17869WS8QTVcz6wOHZIx6gnxgicuRCGA/ lJRQ== X-Gm-Message-State: ACrzQf1fTJEEB3riSF7ROm4L23QdlMkSU8PVrIi/gd5vMqILEi9WlEKN Qq1FoXnyE0WWfTYxrrWLug8= X-Received: by 2002:a17:906:845b:b0:770:86da:9702 with SMTP id e27-20020a170906845b00b0077086da9702mr1086554ejy.244.1663272410566; Thu, 15 Sep 2022 13:06:50 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id i20-20020aa7c9d4000000b00448176872f7sm12212147edt.81.2022.09.15.13.06.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Sep 2022 13:06:50 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla Cc: Tom Rini , Michael Walle , linux-arm-kernel@lists.infradead.org, u-boot@lists.denx.de, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH] nvmem: u-boot-env: find Device Tree nodes for NVMEM cells Date: Thu, 15 Sep 2022 22:06:29 +0200 Message-Id: <20220915200629.10270-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 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.6 at phobos.denx.de X-Virus-Status: Clean From: Rafał Miłecki DT binding allows specifying NVMEM cells as NVMEM device (provider) subnodes. Looks for such subnodes when building NVMEM cells. This allows NVMEM consumers to use U-Boot environment variables. Signed-off-by: Rafał Miłecki --- drivers/nvmem/u-boot-env.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/u-boot-env.c index 9b9abfb8f187..d17a164ae705 100644 --- a/drivers/nvmem/u-boot-env.c +++ b/drivers/nvmem/u-boot-env.c @@ -92,6 +92,7 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf, return -ENOMEM; priv->cells[idx].offset = data_offset + value - data; priv->cells[idx].bytes = strlen(value); + priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name); } if (WARN_ON(idx != priv->ncells))