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: 558321 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp968220map; Wed, 6 Apr 2022 07:32:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI3ZuuHPfjvYmj+4HJrgqaXGnGD4l9g6kxO0ulT/tiPWe3GVE1EUMBp156FdrY85AcH4XL X-Received: by 2002:a17:907:16ac:b0:6e0:1646:9121 with SMTP id hc44-20020a17090716ac00b006e016469121mr8904711ejc.194.1649255564589; Wed, 06 Apr 2022 07:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649255564; cv=none; d=google.com; s=arc-20160816; b=rQec4qxdqbg/JjCKFEhbK3bQsiJwM/anRrkNoiZI9EA1bCDe29kpFmVhKEAzlkJCZj QaoEfyjxtFwrsV17/plYjycfxcK7YmH1W68a2ofQll17+BCUFqz8w1gA8PpwWbY4+LJI T/CDdjycupNrZT5/JEeLXf3ahjrX6YjCzO1rsZcEK3HEpYiExq4vraTSN+rARF7evU2j q+Dv1xqs/VaM4pxcebaHCjyb31i3lM7WcxN6UxXOg11nRH+VFu08gmHrRV5aMOqWhA/B PxKmtsmlqaabzy5nhYMWbqkC1IsOo6Rhc0wL1ZTZn6qiyq2hJ6GJd4EovUagqqYgqxbA U93A== 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=Ua3fT8F2HjRCi9HSGNUFXUuRGoKDbKCgfZ5rZHjpyG0=; b=LTOMWgnfoyiNPmJq8YfxxV8FJiV5MCWf7gXjrHrVEA13Jfta58kQUdu92pj6JdjNmx pVTls4SMUTQHWZ8q2pA8mSioymz15HiDCHhBJy8RdI/TKSG4dq3+m3nSXX2w4JOUhYdK QDCauHEA+wy5sQ0GwDaRmH1WnYrw5xV/Bja7H0wgTJnOdhlaZ8EzeE6RI1HtvLu9gShZ mx9EmcEmcbv0uwNhwJGDkBh/GEBqqjwUlS8HWl9haCINecn4rsmWOpkIjC+TyKEDpcEj GiZ+5s9BBcOv/0k5374CRx6aY8jFLHDEyEH68Tf8u+oDbTeML03zgpmLEMgs6MmCRKnW XJdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SQPNXmNi; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a9-20020a1709063a4900b006df76385bdbsi8233179ejf.123.2022.04.06.07.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:32:44 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SQPNXmNi; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 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-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); /*