]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: Add partition device node to mtd partition devices
authorSascha Hauer <s.hauer@pengutronix.de>
Thu, 9 Feb 2017 10:50:24 +0000 (11:50 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 10 Feb 2017 03:19:25 +0000 (19:19 -0800)
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>
drivers/mtd/mtdpart.c
drivers/mtd/ofpart.c
include/linux/mtd/partitions.h

index 08925bb68fd6a2d092004c799c41c213703ab29f..ea5e5307f667f2a6669287377a633824bb67a4bb 100644 (file)
@@ -432,6 +432,7 @@ static struct mtd_part *allocate_partition(struct mtd_info *master,
        slave->mtd.dev.parent = IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER) ?
                                &master->dev :
                                master->dev.parent;
+       slave->mtd.dev.of_node = part->of_node;
 
        slave->mtd._read = part_read;
        slave->mtd._write = part_write;
index ede407d6e1068826edeebcf1472ab68c12c1fb2d..4644701224931dd2860d8d332b6a1ea5adc01fa3 100644 (file)
@@ -108,6 +108,7 @@ static int parse_ofpart_partitions(struct mtd_info *master,
 
                parts[i].offset = of_read_number(reg, a_cells);
                parts[i].size = of_read_number(reg + a_cells, s_cells);
+               parts[i].of_node = pp;
 
                partname = of_get_property(pp, "label", &len);
                if (!partname)
index 70736e1e6c8f70c5f8f3e53656a282332b33b539..06df1e06b6e03bb953f950ad55e9e516ed5a9dc5 100644 (file)
@@ -41,6 +41,7 @@ struct mtd_partition {
        uint64_t size;                  /* partition size */
        uint64_t offset;                /* offset within the master MTD space */
        uint32_t mask_flags;            /* master MTD flags to mask out for this partition */
+       struct device_node *of_node;
 };
 
 #define MTDPART_OFS_RETAIN     (-3)