git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
mtd
/
chips
/
map_ram.c
diff --git
a/drivers/mtd/chips/map_ram.c
b/drivers/mtd/chips/map_ram.c
index
283be02
..
5cb6d52
100644
(file)
--- a/
drivers/mtd/chips/map_ram.c
+++ b/
drivers/mtd/chips/map_ram.c
@@
-1,7
+1,7
@@
/*
* Common code to handle map devices which are simple RAM
* (C) 2000 Red Hat. GPL'd.
/*
* Common code to handle map devices which are simple RAM
* (C) 2000 Red Hat. GPL'd.
- * $Id: map_ram.c,v 1.2
0 2004/08/09 13:19:43
dwmw2 Exp $
+ * $Id: map_ram.c,v 1.2
2 2005/01/05 18:05:12
dwmw2 Exp $
*/
#include <linux/module.h>
*/
#include <linux/module.h>
@@
-55,12
+55,10
@@
static struct mtd_info *map_ram_probe(struct map_info *map)
#endif
/* OK. It seems to be RAM. */
#endif
/* OK. It seems to be RAM. */
- mtd = k
m
alloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = k
z
alloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd)
return NULL;
if (!mtd)
return NULL;
- memset(mtd, 0, sizeof(*mtd));
-
map->fldrv = &mapram_chipdrv;
mtd->priv = map;
mtd->name = map->name;
map->fldrv = &mapram_chipdrv;
mtd->priv = map;
mtd->name = map->name;
@@
-70,7
+68,8
@@
static struct mtd_info *map_ram_probe(struct map_info *map)
mtd->read = mapram_read;
mtd->write = mapram_write;
mtd->sync = mapram_nop;
mtd->read = mapram_read;
mtd->write = mapram_write;
mtd->sync = mapram_nop;
- mtd->flags = MTD_CAP_RAM | MTD_VOLATILE;
+ mtd->flags = MTD_CAP_RAM;
+ mtd->writesize = 1;
mtd->erasesize = PAGE_SIZE;
while(mtd->size & (mtd->erasesize - 1))
mtd->erasesize = PAGE_SIZE;
while(mtd->size & (mtd->erasesize - 1))
@@
-83,7
+82,7
@@
static struct mtd_info *map_ram_probe(struct map_info *map)
static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
{
static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
{
- struct map_info *map =
(struct map_info *)
mtd->priv;
+ struct map_info *map = mtd->priv;
map_copy_from(map, buf, from, len);
*retlen = len;
map_copy_from(map, buf, from, len);
*retlen = len;
@@
-92,7
+91,7
@@
static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *r
static int mapram_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{
static int mapram_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{
- struct map_info *map =
(struct map_info *)
mtd->priv;
+ struct map_info *map = mtd->priv;
map_copy_to(map, to, buf, len);
*retlen = len;
map_copy_to(map, to, buf, len);
*retlen = len;
@@
-103,7
+102,7
@@
static int mapram_erase (struct mtd_info *mtd, struct erase_info *instr)
{
/* Yeah, it's inefficient. Who cares? It's faster than a _real_
flash erase. */
{
/* Yeah, it's inefficient. Who cares? It's faster than a _real_
flash erase. */
- struct map_info *map =
(struct map_info *)
mtd->priv;
+ struct map_info *map = mtd->priv;
map_word allff;
unsigned long i;
map_word allff;
unsigned long i;
@@
-124,7
+123,7
@@
static void mapram_nop(struct mtd_info *mtd)
/* Nothing to see here */
}
/* Nothing to see here */
}
-int __init map_ram_init(void)
+
static
int __init map_ram_init(void)
{
register_mtd_chip_driver(&mapram_chipdrv);
return 0;
{
register_mtd_chip_driver(&mapram_chipdrv);
return 0;