diff options
Diffstat (limited to 'drivers/mtd/devices/mtdram.c')
-rw-r--r-- | drivers/mtd/devices/mtdram.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c index 3aaca88847d3..fce5ff7589aa 100644 --- a/drivers/mtd/devices/mtdram.c +++ b/drivers/mtd/devices/mtdram.c | |||
@@ -65,6 +65,19 @@ static void ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) | |||
65 | { | 65 | { |
66 | } | 66 | } |
67 | 67 | ||
68 | /* | ||
69 | * Allow NOMMU mmap() to directly map the device (if not NULL) | ||
70 | * - return the address to which the offset maps | ||
71 | * - return -ENOSYS to indicate refusal to do the mapping | ||
72 | */ | ||
73 | static unsigned long ram_get_unmapped_area(struct mtd_info *mtd, | ||
74 | unsigned long len, | ||
75 | unsigned long offset, | ||
76 | unsigned long flags) | ||
77 | { | ||
78 | return (unsigned long) mtd->priv + offset; | ||
79 | } | ||
80 | |||
68 | static int ram_read(struct mtd_info *mtd, loff_t from, size_t len, | 81 | static int ram_read(struct mtd_info *mtd, loff_t from, size_t len, |
69 | size_t *retlen, u_char *buf) | 82 | size_t *retlen, u_char *buf) |
70 | { | 83 | { |
@@ -116,6 +129,7 @@ int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, | |||
116 | mtd->erase = ram_erase; | 129 | mtd->erase = ram_erase; |
117 | mtd->point = ram_point; | 130 | mtd->point = ram_point; |
118 | mtd->unpoint = ram_unpoint; | 131 | mtd->unpoint = ram_unpoint; |
132 | mtd->get_unmapped_area = ram_get_unmapped_area; | ||
119 | mtd->read = ram_read; | 133 | mtd->read = ram_read; |
120 | mtd->write = ram_write; | 134 | mtd->write = ram_write; |
121 | 135 | ||