From patchwork Wed Apr 6 14:32:24 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: 1613983 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=SQPNXmNi; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KYRnB5lNdz9sFq for ; Thu, 7 Apr 2022 00:32:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7A30383937; Wed, 6 Apr 2022 16:32:40 +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="SQPNXmNi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 144C283D97; Wed, 6 Apr 2022 16:32:38 +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-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (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 D8EEB80331 for ; Wed, 6 Apr 2022 16:32:33 +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-lj1-x235.google.com with SMTP id b21so3435327ljf.11 for ; Wed, 06 Apr 2022 07:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ua3fT8F2HjRCi9HSGNUFXUuRGoKDbKCgfZ5rZHjpyG0=; b=SQPNXmNiW4rebr/QZg8/x5gtfvrgJQwi5YSckBhzcsA/q6ij9L10+3V6bYO0oKcSWn aTl+Fipv6314CwOeTNLPN1Ahw8+BbB+dF50viZA/mueApGxw5UJLAU2VkT7k+o7NpZ5R gFhNS1UeW3tSQaOThQB7mcdx0Gnmf7uvLMphjBKBGJe4imShimFp/K/y16Z2c76Jb6K7 EqKwrVND/culdATDDuHsi4ocl0VyJtd5YzydEyeRM+UcVNoOnLEn/hEjyBIIdlkMKI58 9fIncOk22Bat/fwnxRSOJttm1x2rivvj614Yh7GYRYxWuxjCaGEv4VqBCPrhzRdIGgC0 yvzw== 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:mime-version :content-transfer-encoding; bh=Ua3fT8F2HjRCi9HSGNUFXUuRGoKDbKCgfZ5rZHjpyG0=; b=zPYyWnmmL2dQeGnghbDsHCbRacn1AplDCshsihI2huEiS4ao1XynlxznpNZt3zW/ZL 4JmfPsD+R4gt1CAyMNdqQ4roHBVhNnFqOPB/4OBMyUsbpkrVU2ASGUhLuVbROz0Ym3bJ aw/XcHe7InhPwDXUoUsnc9yVhdZCWBk6qdwnf+1ICVI0zcJgnsCiRZ9rTR+Rc2HmllsM d1Q4l10pRtGLKefC8HSREv4aNet38ep1/k9RRi63p482c3/iB5/e4+I8bJFu4eLQM2Gm YcwOse7lugMEH54IcjfDa6oHbzNiQO7Mrk5L/ozC8nfmBDKs72OJy7/xRd4s8yCGwDQg TuRw== X-Gm-Message-State: AOAM531YNxFpgxsbPi30heHxOmaWtFOibGLOnwNEhrp+DtCte1HF2q/+ aLbcshL16MUt7tWTZGEgYJU= X-Google-Smtp-Source: ABdhPJwtAaDgzqgeqxymEWZuhij4m770G+5LX+N8/5brJHxkfnLHz1BnJ76uIcXGJs0etWJRH5e16A== X-Received: by 2002:a2e:bc19:0:b0:249:b29c:7f5e with SMTP id b25-20020a2ebc19000000b00249b29c7f5emr5677249ljf.312.1649255552987; Wed, 06 Apr 2022 07:32:32 -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 s2-20020a197702000000b0044a693649b9sm1843857lfc.131.2022.04.06.07.32.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:32:32 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Tom Rini , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, u-boot@lists.denx.de, devicetree@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1p?= =?utf-8?b?xYJlY2tp?= Subject: [PATCH 1/2] mtd: call of_platform_populate() for MTD partitions Date: Wed, 6 Apr 2022 16:32:24 +0200 Message-Id: <20220406143225.28107-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.5 at phobos.denx.de X-Virus-Status: Clean From: Rafał Miłecki Until this change MTD subsystem supported handling partitions only with MTD partitions parsers. That's a specific / limited API designed around partitions. Some MTD partitions may however require different handling. They may contain specific data that needs to be parsed and somehow extracted. For that purpose MTD subsystem should allow binding of standard platform drivers. An example can be U-Boot (sub)partition with environment variables. There exist a "u-boot,env" DT binding for MTD (sub)partition that requires an NVMEM driver. Ref: 5db1c2dbc04c ("dt-bindings: nvmem: add U-Boot environment variables binding") Signed-off-by: Rafał Miłecki --- drivers/mtd/mtdpart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 357661b62c94..9fce946fa69c 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "mtdcore.h" @@ -593,6 +594,7 @@ static int mtd_part_of_parse(struct mtd_info *master, continue; ret = mtd_part_do_parse(parser, master, pparts, NULL); if (ret > 0) { + of_platform_populate(np, NULL, NULL, &master->dev); of_node_put(np); return ret; } @@ -600,6 +602,7 @@ static int mtd_part_of_parse(struct mtd_info *master, if (ret < 0 && !err) err = ret; } + of_platform_populate(np, NULL, NULL, &master->dev); of_node_put(np); /*