From patchwork Mon Feb 28 09:33:51 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: 12762611 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 18E8BC433EF for ; Mon, 28 Feb 2022 09:35:26 +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:References:In-Reply-To: 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: List-Owner; bh=KnEWSc62NuCem7sZGj4310nqs+Cm1kh3YUiAjeOmBog=; b=hlodAzYNCtUT7i lCP09oHmo7etndlFPqMw1bd/wHGK5V9rvVhd57A3vapcVQnn56IsQ0gfykRJQe99bSgkMv0bfe1jq dwpJjm4dpt4DWvQZtd0T8jnrdkcbsg2XwGng/HkGfVwdf+SeOV8PUerEKUD7XFVkb+LgGp3D6sXlt TeR/l4UIrN7pH1Pof1SVwByt3/S4UYx0nKDFlc5APmK3mlzG8GZb3DU6yJzRiZJOjcq+VFUj268N8 iOxpymVRaplZZK+PnCiwl2wMzbEafMdrcxgMg5QdybXbS0XC9j2Top1dO2M8402e8x3qfqvw7wRJu lEf0KTQCPniZ6NdkZjIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOcQA-00BH1K-Cy; Mon, 28 Feb 2022 09:34:22 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOcPw-00BGwl-ME for linux-arm-kernel@lists.infradead.org; Mon, 28 Feb 2022 09:34:12 +0000 Received: by mail-lf1-x12c.google.com with SMTP id m14so20274624lfu.4 for ; Mon, 28 Feb 2022 01:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vNW8B911OQBRBUW/DpOFF8iaYDouAHt80BzfGLFj4rk=; b=ifm8un2LzrGCL6C6xB27XvYINTfvoIQNf9qJWpyHsuwa0w8B+Oe0N2oxflFKS+yTG0 qafUp62HAXtgkMulaEsdBqcm38zCscXbiyu+B1+/4X2mbGTa60UVQ2RvmhAluJnsIwUh lngnfNQwh9FEBuFNVXGaVkhxGwFm7cvntg9sDJYSoZp+ng77lN8P2UClkD914TtRfBXk 2af65uJ3BiAUOwqsepNJvrS3jjLOho3BJ+uLn0b13DPFN21EmHweT4CxSlUQ8Ms18FwS xxEXk9I7xZjzd81uWcXDG452YQk0ouE5L4F8TgYtW7Z6a2AIEweNNmpPPnh8aiaXdDKr reKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vNW8B911OQBRBUW/DpOFF8iaYDouAHt80BzfGLFj4rk=; b=KhW1jqsoTT9EOqET4a4SH1HDvL2esQMOsT88mcIHl5yd2kkXU1Q7pqW+BNcj755COj TqBWfGH2U4nkg6FAulf6vjdVPEmqD3E5eQDNiV/OZI6+XJFDlZA6PBcaO9yIDy8ua5un RE8+A2G0wYE6QOw7pwNpFbATeM/c7GuVLde0TnSoODwcA4ZlEpPz8pXh7jL6zQ3CxwVZ AOIRlunbzCzK/V2NlFjOGGdQkD9C+08s+VrzMD4Bh/om0QWIYRCQMoLGKxc8SsOsor93 vrZWABvlRR8P9cR9kiB/SHWiHO3EFQ4lMflpnbwCWoIT5f9Zvo7t0UAoyNN4MqthCFJI iUaQ== X-Gm-Message-State: AOAM533ywMkdE9A0+UW4VrmF5Eec7feHKkVcdXPRetM68iNHHEoZh5do wEo80nufsL0/We723KKGf8U= X-Google-Smtp-Source: ABdhPJwq15AXczlwtQ3CyPeeEL2d3+ucD7NWWmlTWuUOcnhvnGMcdNyfI2le/5F18R1XrR8MDBKqxQ== X-Received: by 2002:a05:6512:783:b0:443:ae8d:6eda with SMTP id x3-20020a056512078300b00443ae8d6edamr12574542lfr.153.1646040846889; Mon, 28 Feb 2022 01:34:06 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id k7-20020a0565123d8700b00443cec880e5sm876184lfv.4.2022.02.28.01.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 01:34:06 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla Cc: Rob Herring , Krzysztof Kozlowski , Florian Fainelli , Hauke Mehrtens , bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 2/2] nvmem: brcm_nvram: find Device Tree nodes for NVMEM cells Date: Mon, 28 Feb 2022 10:33:51 +0100 Message-Id: <20220228093351.28162-2-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228093351.28162-1-zajec5@gmail.com> References: <20220228093351.28162-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_013408_749506_46316247 X-CRM114-Status: GOOD ( 12.81 ) 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 for Broadcom's NVRAM supports specifying NVMEM cells as NVMEM device (provider) subnodes. Look for such subnodes when collecing NVMEM cells. This allows NVMEM consumers to use NVRAM variables. Signed-off-by: Rafał Miłecki --- drivers/nvmem/brcm_nvram.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvmem/brcm_nvram.c b/drivers/nvmem/brcm_nvram.c index 439f00b9eef6..450b927691c3 100644 --- a/drivers/nvmem/brcm_nvram.c +++ b/drivers/nvmem/brcm_nvram.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -72,6 +73,7 @@ static int brcm_nvram_add_cells(struct brcm_nvram *priv, uint8_t *data, return -ENOMEM; priv->cells[idx].offset = value - (char *)data; priv->cells[idx].bytes = strlen(value); + priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name); } return 0;