diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-03-30 22:58:19 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-03-31 18:43:24 +0200 |
commit | 617192a1053a6614c2ad09054e5ee4f517f02308 (patch) | |
tree | 49cec2a4dce873d53779066cf934ec25947184f7 /drivers | |
parent | 1accb5ecdd59e255f01b98b837138c553582ab4c (diff) | |
download | barebox-617192a1053a6614c2ad09054e5ee4f517f02308.tar.gz barebox-617192a1053a6614c2ad09054e5ee4f517f02308.tar.xz |
of: partitions: flag partitions from a partition table
We are going to call the of_partition_fixup for regular block
devices like MMC/SD aswell. Add a flag to partitions indicating
they are instanciated from a on-disk partition table so that they
won't be added as device tree partitions during fixup.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/of/partition.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/of/partition.c b/drivers/of/partition.c index e66b6ccc16..25b41cb012 100644 --- a/drivers/of/partition.c +++ b/drivers/of/partition.c @@ -140,6 +140,8 @@ static int of_partition_fixup(struct device_node *root, void *ctx) return -EINVAL; list_for_each_entry(partcdev, &cdev->partitions, partition_entry) { + if (partcdev->flags & DEVFS_PARTITION_FROM_TABLE) + continue; n_parts++; } @@ -191,12 +193,14 @@ static int of_partition_fixup(struct device_node *root, void *ctx) list_for_each_entry(partcdev, &cdev->partitions, partition_entry) { int na, ns, len = 0; - char *name = basprintf("partition@%0llx", - partcdev->offset); + char *name; void *p; u8 tmp[16 * 16]; /* Up to 64-bit address + 64-bit size */ loff_t partoffset; + if (partcdev->flags & DEVFS_PARTITION_FROM_TABLE) + continue; + if (partcdev->mtd) partoffset = partcdev->mtd->master_offset; else |