summaryrefslogtreecommitdiffstats
path: root/linux-2.4.x/drivers/mtd/chips/map_rom.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-2.4.x/drivers/mtd/chips/map_rom.c')
-rw-r--r--linux-2.4.x/drivers/mtd/chips/map_rom.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/linux-2.4.x/drivers/mtd/chips/map_rom.c b/linux-2.4.x/drivers/mtd/chips/map_rom.c
index d077bac..624c12c 100644
--- a/linux-2.4.x/drivers/mtd/chips/map_rom.c
+++ b/linux-2.4.x/drivers/mtd/chips/map_rom.c
@@ -1,10 +1,9 @@
/*
* Common code to handle map devices which are simple ROM
* (C) 2000 Red Hat. GPL'd.
- * $Id: map_rom.c,v 1.17 2001/10/02 15:05:12 dwmw2 Exp $
+ * $Id: map_rom.c,v 1.23 2005/01/05 18:05:12 dwmw2 Exp $
*/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -12,21 +11,23 @@
#include <asm/byteorder.h>
#include <linux/errno.h>
#include <linux/slab.h>
-
+#include <linux/init.h>
+#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
+#include <linux/mtd/compatmac.h>
static int maprom_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int maprom_write (struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
static void maprom_nop (struct mtd_info *);
-struct mtd_info *map_rom_probe(struct map_info *map);
+static struct mtd_info *map_rom_probe(struct map_info *map);
static struct mtd_chip_driver maprom_chipdrv = {
- probe: map_rom_probe,
- name: "map_rom",
- module: THIS_MODULE
+ .probe = map_rom_probe,
+ .name = "map_rom",
+ .module = THIS_MODULE
};
-struct mtd_info *map_rom_probe(struct map_info *map)
+static struct mtd_info *map_rom_probe(struct map_info *map)
{
struct mtd_info *mtd;
@@ -49,16 +50,16 @@ struct mtd_info *map_rom_probe(struct map_info *map)
while(mtd->size & (mtd->erasesize - 1))
mtd->erasesize >>= 1;
- MOD_INC_USE_COUNT;
+ __module_get(THIS_MODULE);
return mtd;
}
static int maprom_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);
+ map_copy_from(map, buf, from, len);
*retlen = len;
return 0;
}
@@ -74,7 +75,7 @@ static int maprom_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *re
return -EIO;
}
-int __init map_rom_init(void)
+static int __init map_rom_init(void)
{
register_mtd_chip_driver(&maprom_chipdrv);
return 0;