[PATCH] mtd: parsers: ofpart: limit parsing of deprecated DT syntax

Miquel Raynal miquel.raynal at bootlin.com
Thu Mar 11 11:42:27 GMT 2021


On Tue, 2021-03-02 at 19:00:12 UTC, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= wrote:
> From: Rafał Miłecki <rafal at milecki.pl>
> 
> For backward compatibility ofpart still supports the old syntax like:
> spi-flash at 0 {
> 	compatible = "jedec,spi-nor";
> 	reg = <0x0>;
> 
> 	partition at 0 {
> 		label = "bootloader";
> 		reg = <0x0 0x100000>;
> 	};
> };
> (without "partitions" subnode).
> 
> There is no reason however to support nested partitions without a clear
> "compatible" string like:
> partitions {
> 	compatible = "fixed-partitions";
> 	#address-cells = <1>;
> 	#size-cells = <1>;
> 
> 	partition at 0 {
> 		label = "bootloader";
> 		reg = <0x0 0x100000>;
> 
> 		partition at 0 {
> 			label = "config";
> 			reg = <0x80000 0x80000>;
> 		};
> 	};
> };
> (we never officially supported or documented that).
> 
> Make sure ofpart doesn't attempt to parse above.
> 
> Cc: Ansuel Smith <ansuelsmth at gmail.com>
> Signed-off-by: Rafał Miłecki <rafal at milecki.pl>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel



More information about the linux-mtd mailing list