Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: Add partition device node to mtd partition devices

The user visible change here is that mtd partitions get an of_node link
in sysfs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>

authored by

Sascha Hauer and committed by
Brian Norris
42e9401b 89a0d9a9

+3
+1
drivers/mtd/mtdpart.c
··· 432 432 slave->mtd.dev.parent = IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER) ? 433 433 &master->dev : 434 434 master->dev.parent; 435 + slave->mtd.dev.of_node = part->of_node; 435 436 436 437 slave->mtd._read = part_read; 437 438 slave->mtd._write = part_write;
+1
drivers/mtd/ofpart.c
··· 108 108 109 109 parts[i].offset = of_read_number(reg, a_cells); 110 110 parts[i].size = of_read_number(reg + a_cells, s_cells); 111 + parts[i].of_node = pp; 111 112 112 113 partname = of_get_property(pp, "label", &len); 113 114 if (!partname)
+1
include/linux/mtd/partitions.h
··· 41 41 uint64_t size; /* partition size */ 42 42 uint64_t offset; /* offset within the master MTD space */ 43 43 uint32_t mask_flags; /* master MTD flags to mask out for this partition */ 44 + struct device_node *of_node; 44 45 }; 45 46 46 47 #define MTDPART_OFS_RETAIN (-3)