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: 12977772 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6539EC32771 for ; Thu, 15 Sep 2022 20:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MaOx7cYA0PHqV20iaNAqsfeTq1YWTCShGhfA95Q6Z+4=; b=FvzRHOJw5FuQrF bqu1Jz0jH9BjBC4Go5KEyrbSL5grwPJ4ImeF+Shwt+mRXE64Y6M15+jVf4et2jlR35tvfq6GEcgPy +LET6vBUhoM7NbidpMp0R/Kt5MEMOI0nEpkXiCP1uOu7e4+N29Q0+DRvkH7cOWKmJoyLmCXDyaxCm 6s89gbcZ7zZe9kZ+yrjH9QqkUBa4LJbYDQv8XeUgp4fdrD4DUwhMNmTG2tuhgW3iJBsNEysUH6cld TZRdqr/Gwm7zRlmr/QSilcBf55QTtc5rFGRZpssOa4Go25a3To6z/YA2rD22os86x+MIqAJsjMmwy QgNPOaEqwmN4hefXXEAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYv8U-00GMKb-06; Thu, 15 Sep 2022 20:06:58 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYv8R-00GMH2-P7 for linux-arm-kernel@lists.infradead.org; Thu, 15 Sep 2022 20:06:57 +0000 Received: by mail-ej1-x629.google.com with SMTP id u9so44652652ejy.5 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=TTirjoFEPXH8IPyNBbY3aPiL+ib3ZNuZJJvKcTi4qyEXWTHOK8LI/FsHaZ8LmdTUvi toic8LkxzLIPZ2mWatJ52VvfFyZUG3Lod2W0HOiSHENWzhqfH0MOW5KhOx4hbCMOZuyD z557/ELAHBM9ZouV0po/+yE+8dWEwaxzwV/L5iW6CfwDDzM8mTi1RzpqDIr0KE5yysIR yPB7hh8qrFU5ziEHIXVD0T45ZeUgAU4WNj0psruTFABFBPfU4X3qJCPSCADKiPxed5jJ rDDA1LcddWPF/isUvuL/YpcDi6KWQsM52bYnitH8fJrXc4jyM86PsCDGfJ6ri81VjI/U 6/fg== X-Gm-Message-State: ACrzQf2b0Cc9FS1ddNNwzocrG0qcCFAYuymUuttzctLqJrJs8M22AIiV SJYPnth0YZAskU4J/6RFZHc= X-Google-Smtp-Source: AMsMyM5mQDXzHK6KUdvG+weZB9xH81LSJyAp98vY/CykfCpwBs5YqTDDymHQg6sOlWQiiHN6X8DL0w== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220915_130655_837351_B5AD2579 X-CRM114-Status: GOOD ( 10.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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))