diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-06 17:56:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-06 17:56:26 -0400 |
commit | 22ae77bc7ac115b9d518d5cbc13d39317079b2b0 (patch) | |
tree | 574b7af678c0b1ad2c891ac5066292746788ece8 /drivers/mtd/chips/map_ram.c | |
parent | e379ec7c42343c6b6ef06a98de7c94db41c1423e (diff) | |
parent | 30bbf1406714cf464c56e96e4ad6a291907f5023 (diff) |
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (53 commits)
[MTD] struct device - replace bus_id with dev_name(), dev_set_name()
[MTD] [NOR] Fixup for Numonyx M29W128 chips
[MTD] mtdpart: Make ecc_stats more realistic.
powerpc/85xx: TQM8548: Update DTS file for multi-chip support
powerpc: NAND: FSL UPM: document new bindings
[MTD] [NAND] FSL-UPM: Add wait flags to support board/chip specific delays
[MTD] [NAND] FSL-UPM: add multi chip support
[MTD] [NOR] Add device parent info to physmap_of
[MTD] [NAND] Add support for NAND on the Socrates board
[MTD] [NAND] Add support for 4KiB pages.
[MTD] sysfs support should not depend on CONFIG_PROC_FS
[MTD] [NAND] Add parent info for CAFÉ controller
[MTD] support driver model updates
[MTD] driver model updates (part 2)
[MTD] driver model updates
[MTD] [NAND] move gen_nand's probe function to .devinit.text
[MTD] [MAPS] move sa1100 flash's probe function to .devinit.text
[MTD] fix use after free in register_mtd_blktrans
[MTD] [MAPS] Drop now unused sharpsl-flash map
[MTD] ofpart: Check name property to determine partition nodes.
...
Manually fix trivial conflict in drivers/mtd/maps/Makefile
Diffstat (limited to 'drivers/mtd/chips/map_ram.c')
-rw-r--r-- | drivers/mtd/chips/map_ram.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c index 072dd8abf33a..6bdc50c727e7 100644 --- a/drivers/mtd/chips/map_ram.c +++ b/drivers/mtd/chips/map_ram.c | |||
@@ -21,6 +21,8 @@ static int mapram_write (struct mtd_info *, loff_t, size_t, size_t *, const u_ch | |||
21 | static int mapram_erase (struct mtd_info *, struct erase_info *); | 21 | static int mapram_erase (struct mtd_info *, struct erase_info *); |
22 | static void mapram_nop (struct mtd_info *); | 22 | static void mapram_nop (struct mtd_info *); |
23 | static struct mtd_info *map_ram_probe(struct map_info *map); | 23 | static struct mtd_info *map_ram_probe(struct map_info *map); |
24 | static unsigned long mapram_unmapped_area(struct mtd_info *, unsigned long, | ||
25 | unsigned long, unsigned long); | ||
24 | 26 | ||
25 | 27 | ||
26 | static struct mtd_chip_driver mapram_chipdrv = { | 28 | static struct mtd_chip_driver mapram_chipdrv = { |
@@ -64,6 +66,7 @@ static struct mtd_info *map_ram_probe(struct map_info *map) | |||
64 | mtd->type = MTD_RAM; | 66 | mtd->type = MTD_RAM; |
65 | mtd->size = map->size; | 67 | mtd->size = map->size; |
66 | mtd->erase = mapram_erase; | 68 | mtd->erase = mapram_erase; |
69 | mtd->get_unmapped_area = mapram_unmapped_area; | ||
67 | mtd->read = mapram_read; | 70 | mtd->read = mapram_read; |
68 | mtd->write = mapram_write; | 71 | mtd->write = mapram_write; |
69 | mtd->sync = mapram_nop; | 72 | mtd->sync = mapram_nop; |
@@ -79,6 +82,20 @@ static struct mtd_info *map_ram_probe(struct map_info *map) | |||
79 | } | 82 | } |
80 | 83 | ||
81 | 84 | ||
85 | /* | ||
86 | * Allow NOMMU mmap() to directly map the device (if not NULL) | ||
87 | * - return the address to which the offset maps | ||
88 | * - return -ENOSYS to indicate refusal to do the mapping | ||
89 | */ | ||
90 | static unsigned long mapram_unmapped_area(struct mtd_info *mtd, | ||
91 | unsigned long len, | ||
92 | unsigned long offset, | ||
93 | unsigned long flags) | ||
94 | { | ||
95 | struct map_info *map = mtd->priv; | ||
96 | return (unsigned long) map->virt + offset; | ||
97 | } | ||
98 | |||
82 | static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) | 99 | static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) |
83 | { | 100 | { |
84 | struct map_info *map = mtd->priv; | 101 | struct map_info *map = mtd->priv; |