diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-01-14 10:30:20 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-02-26 08:33:18 +0100 |
commit | e25cabf6a36625abee869d6caea4a5fa68b7bb0c (patch) | |
tree | 2142f73e066aa6330deb32af9a02f0fb296c6250 /drivers/mtd/partition.c | |
parent | 6f0a7d82a14ea868ed9f218f121798088376a8cf (diff) | |
download | barebox-e25cabf6a36625abee869d6caea4a5fa68b7bb0c.tar.gz barebox-e25cabf6a36625abee869d6caea4a5fa68b7bb0c.tar.xz |
mtd: partition: only copy selected fields to partition
struct mtd_info contains members which should not be copied
to the new partition, like for example the class_dev, so
only copy selected members of struct mtd_info to the partition.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/partition.c')
-rw-r--r-- | drivers/mtd/partition.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/mtd/partition.c b/drivers/mtd/partition.c index d2045cc9ca..2551c2d5e0 100644 --- a/drivers/mtd/partition.c +++ b/drivers/mtd/partition.c @@ -83,7 +83,18 @@ struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t offset, size_t si part = xzalloc(sizeof(*part)); - memcpy(part, mtd, sizeof(*part)); + part->type = mtd->type; + part->flags = mtd->flags; + part->parent = mtd->parent; + part->erasesize = mtd->erasesize; + part->writesize = mtd->writesize; + part->writebufsize = mtd->writebufsize; + part->oobsize = mtd->oobsize; + part->oobavail = mtd->oobavail; + part->bitflip_threshold = mtd->bitflip_threshold; + part->ecclayout = mtd->ecclayout; + part->ecc_strength = mtd->ecc_strength; + part->subpage_sft = mtd->subpage_sft; /* * find the number of eraseregions the partition includes. |