diff options
author | David Howells <dhowells@redhat.com> | 2009-02-12 05:40:00 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-03-24 05:00:19 -0400 |
commit | 402d326519c1a4859c527702383f4e60f606ef52 (patch) | |
tree | beb302d56d7671d372ae73f2664feed2a5b1226d /drivers/mtd/mtdpart.c | |
parent | 9ce969082e490d0a5a81862b364337c93dc3482a (diff) |
NOMMU: Present backing device capabilities for MTD chardevs
Present backing device capabilities for MTD character device files to allow
NOMMU mmap to do direct mapping where possible.
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/mtdpart.c')
-rw-r--r-- | drivers/mtd/mtdpart.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 144e6b613a77..06d5b9d8853a 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -84,6 +84,18 @@ static void part_unpoint(struct mtd_info *mtd, loff_t from, size_t len) | |||
84 | part->master->unpoint(part->master, from + part->offset, len); | 84 | part->master->unpoint(part->master, from + part->offset, len); |
85 | } | 85 | } |
86 | 86 | ||
87 | static unsigned long part_get_unmapped_area(struct mtd_info *mtd, | ||
88 | unsigned long len, | ||
89 | unsigned long offset, | ||
90 | unsigned long flags) | ||
91 | { | ||
92 | struct mtd_part *part = PART(mtd); | ||
93 | |||
94 | offset += part->offset; | ||
95 | return part->master->get_unmapped_area(part->master, len, offset, | ||
96 | flags); | ||
97 | } | ||
98 | |||
87 | static int part_read_oob(struct mtd_info *mtd, loff_t from, | 99 | static int part_read_oob(struct mtd_info *mtd, loff_t from, |
88 | struct mtd_oob_ops *ops) | 100 | struct mtd_oob_ops *ops) |
89 | { | 101 | { |
@@ -342,6 +354,7 @@ static struct mtd_part *add_one_partition(struct mtd_info *master, | |||
342 | 354 | ||
343 | slave->mtd.name = part->name; | 355 | slave->mtd.name = part->name; |
344 | slave->mtd.owner = master->owner; | 356 | slave->mtd.owner = master->owner; |
357 | slave->mtd.backing_dev_info = master->backing_dev_info; | ||
345 | 358 | ||
346 | slave->mtd.read = part_read; | 359 | slave->mtd.read = part_read; |
347 | slave->mtd.write = part_write; | 360 | slave->mtd.write = part_write; |
@@ -354,6 +367,8 @@ static struct mtd_part *add_one_partition(struct mtd_info *master, | |||
354 | slave->mtd.unpoint = part_unpoint; | 367 | slave->mtd.unpoint = part_unpoint; |
355 | } | 368 | } |
356 | 369 | ||
370 | if (master->get_unmapped_area) | ||
371 | slave->mtd.get_unmapped_area = part_get_unmapped_area; | ||
357 | if (master->read_oob) | 372 | if (master->read_oob) |
358 | slave->mtd.read_oob = part_read_oob; | 373 | slave->mtd.read_oob = part_read_oob; |
359 | if (master->write_oob) | 374 | if (master->write_oob) |