Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1292738rwe; Thu, 1 Sep 2022 16:13:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR7bW5JUzbqLfYUTQgtNSm4YBj5XhxdYJHSSL0aFec7EmXg3rBuLosGE9u8Vz4Mm6PJNR0lg X-Received: by 2002:a17:907:3f2a:b0:741:6dc2:ddd8 with SMTP id hq42-20020a1709073f2a00b007416dc2ddd8mr16837037ejc.658.1662073988969; Thu, 01 Sep 2022 16:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662073988; cv=none; d=google.com; s=arc-20160816; b=oUkWIDRXTu6/9IKRUWOEa/N+HsEftzfOmui4n9e+YnG31tWSkFMyRfaSUzy0m6p80O 7Y8aBIg09uA+ngVYSGUZqSqxS3P2ob4xyUVtpnhnAEpw0wL+x8K0eyKya6cKxyAOOXyI A2Xjl0UUiJu6/mh7B9t/nKRqnxYyPtwnIKtSLVzmh9f+o6Bi5NZdHzaSOdmiTRusQVZy zuhLhRECPewpBZb0Am+Sm2Uy4LOXp31RYNxsHdXmfIb99MTNAThZOqlDJgevhITnl1/Z MD2U1sMoXNpo3HGLDtotfd7BIuhmaIQ8YBLF7qZUjs3VXmS3ggukAXedGeHkNwrdeqDj mTNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KKvaxDezpVglQbvUlzzvJIhuhv9lpFlXJWy0f0xohsQ=; b=Paq3fDv2aSV8xLlpXS1HoI6Rp++Mt5Dhcb3CtLfjtZ3tL1xNSiqc+NwLerwVUFfVSI 3c0ow3mZR2udMlNEC5WjStWxD7Mm4QzI+U3quf/ZuZ8zpauN13yj6mWyqJ/VsKqKyB+2 x5g6g6UZ9ptsn+6Y7oq4IgOytnJBvI9oc4FK5C8ZHQIzwwrGQid5RGsTpJ2NQe7b7zYw F+VXbe78K0Cz5YAXljq1RZNlyAgzw73bKiiohIJUZO7GICR36bhI2O93TlaCY+M8Pl5L qjLRvvbxAPUzJPkHWLIs2dq6/lG0tJrHeM8a7l/RPTrnDcEoOpQA6CikfLFYzJsl+S7M oduQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=hSJiAoEq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr21-20020a170906d55500b0073d7121c675si376377ejc.408.2022.09.01.16.12.42; Thu, 01 Sep 2022 16:13:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=hSJiAoEq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235001AbiIAWWz (ORCPT + 99 others); Thu, 1 Sep 2022 18:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234968AbiIAWWH (ORCPT ); Thu, 1 Sep 2022 18:22:07 -0400 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E8167962F; Thu, 1 Sep 2022 15:19:33 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id EF3D62221; Fri, 2 Sep 2022 00:19:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1662070756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KKvaxDezpVglQbvUlzzvJIhuhv9lpFlXJWy0f0xohsQ=; b=hSJiAoEqoFLiXl618NYj5ODCGWBKsRSBRjJyZajQCq7YvEFL7TUa2cRG0rF0YAxW3ml3S/ kYWFF/sQeJvRRn0RC1oJALu4df2WuE3VFELUQnzMrOYG2cJzE4LMOL9VVILuduncXO+Pxz cCBvFy+vBwKEeKaSkAxyKbmuEX8H7PE6pRXJ9fbIRbwEG0jFZqOGjXlKqaw6Ix4Ria98Zc TXdV4OVehj8MT25E3CPtFPX0oyfokMnHje+BuQCyHbzHTCF0uB1QGvqagVu/3+xSy4PrH6 eQNhkvXMJ01RqVJAYFYBhBIhl7gdB8E10UYdrz/Ex6JNy2QkgvTxiMjV1Fk9jA== From: Michael Walle To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , Shawn Guo , Li Yang , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Frank Rowand Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ahmad Fatoum , Philipp Zabel , Michael Walle Subject: [RFC PATCH v2 20/20] nvmem: layouts: u-boot-env: add device node Date: Fri, 2 Sep 2022 00:18:57 +0200 Message-Id: <20220901221857.2600340-21-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220901221857.2600340-1-michael@walle.cc> References: <20220901221857.2600340-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Register the device node so we can actually make use of the cells from within the device tree. This obviously only works if the environment variable name can be mapped to the device node, which isn't always the case. Think of "_" vs "-". But for simple things like ethaddr, this will work. Signed-off-by: Michael Walle --- changes since v1: - none drivers/nvmem/layouts/u-boot-env.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvmem/layouts/u-boot-env.c b/drivers/nvmem/layouts/u-boot-env.c index f184d1424b1e..d2adc246c93a 100644 --- a/drivers/nvmem/layouts/u-boot-env.c +++ b/drivers/nvmem/layouts/u-boot-env.c @@ -8,6 +8,7 @@ #include #include #include +#include #include enum u_boot_env_format { @@ -47,6 +48,7 @@ static int u_boot_env_add_cells(struct device *dev, info.name = var; info.offset = data_offset + value - data; info.bytes = strlen(value); + info.np = of_get_child_by_name(dev->of_node, var); err = nvmem_add_one_cell(nvmem, &info); if (err) -- 2.30.2