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: 12803559 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 7D668C433F5 for ; Wed, 6 Apr 2022 14:34:00 +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=vYSgnPI47qL4UfmvPCtZc2Pns+DaiBjfGFEdXt4qV4M=; b=v/5LyijsRvzbZO g5f/j9tOEWYDKTV324T4gQtkmmADfksn/6jFsFV0otCpFPV3Dm6mb4epBCrYeVAmI9Qdpmn/XwvN5 oshF8FU15cT2ZgjbwQwyrXq1Rhld5lBaG8BUnJ69todL92y365MHgBg0mIuJEcZBc9LyNpE5H5wJY qMYZ4nh0MkCUNbQnyvtsx9in/lYbhva4Edg6OOWp1Va0LlFKDfK9O0SyEfV1NNwb85IVaEdBoYZWQ d/4AaZrabiisOFg+APt4PQm4snqVplSJmHnXtvkqvx0zk0xT29P7LK0EFEQFEOIqhkW2Ac8OpD3fv /JZgN5D/3pzfnx0HyDsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc6iI-006Wk0-2G; Wed, 06 Apr 2022 14:32:50 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc6i5-006Wgj-LC; Wed, 06 Apr 2022 14:32:39 +0000 Received: by mail-lj1-x22c.google.com with SMTP id g24so3466914lja.7; Wed, 06 Apr 2022 07:32:34 -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=5YikPpBcVR+pIXFqS1d5un+dsxEvls/OA58sii4Xv8uP39LDBoqg8UhoZU5yZAibXd 3Y6LV5L1BgkalcwCMfh1ROJiqtX1dKS2FQW7fXaC/77pq+nSeSZbK66z6Pi/WvTTvu1w rG3ey4dSCve2YzoufQQ0X+NmwS6zM18qlZ6IIZeJopN0SbcPhaJjGAvZlAsHijgALbA6 RBUfoWrc5WXkZVClPG9klWj+KTzhcVLOHAGtvtmcMZOZ+X9CBmBBA6/QjYD28BT/GDKO 9jlOxjFo/njeSRH5cBVuvHjQbtmAStTkNjK1kkWUTQoshbnM3qpfnTepNa/jOOmj6Gn6 ofcQ== X-Gm-Message-State: AOAM531YHIpy9cGIDmgqF5ycX7nN4+T3RASTQMCXl0lAvvanXgRBvK5d jgo6dLoAgxS8QSvWuxb8tiQ= 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220406_073237_753263_0C1F896E X-CRM114-Status: GOOD ( 13.16 ) 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 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); /*