summaryrefslogtreecommitdiffstats
path: root/linux-2.4.x/drivers/mtd/chips/map_absent.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-2.4.x/drivers/mtd/chips/map_absent.c')
-rw-r--r--linux-2.4.x/drivers/mtd/chips/map_absent.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/linux-2.4.x/drivers/mtd/chips/map_absent.c b/linux-2.4.x/drivers/mtd/chips/map_absent.c
index 9478d0e..a611de9 100644
--- a/linux-2.4.x/drivers/mtd/chips/map_absent.c
+++ b/linux-2.4.x/drivers/mtd/chips/map_absent.c
@@ -1,11 +1,11 @@
/*
* Common code to handle absent "placeholder" devices
* Copyright 2001 Resilience Corporation <ebrower@resilience.com>
- * $Id: map_absent.c,v 1.2 2001/10/02 15:05:12 dwmw2 Exp $
+ * $Id: map_absent.c,v 1.6 2005/11/07 11:14:23 gleixner Exp $
*
* This map driver is used to allocate "placeholder" MTD
- * devices on systems that have socketed/removable media.
- * Use of this driver as a fallback preserves the expected
+ * devices on systems that have socketed/removable media.
+ * Use of this driver as a fallback preserves the expected
* registration of MTD device nodes regardless of probe outcome.
* A usage example is as follows:
*
@@ -23,9 +23,10 @@
#include <linux/kernel.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 map_absent_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int map_absent_write (struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
@@ -36,10 +37,10 @@ static void map_absent_destroy (struct mtd_info *);
static struct mtd_chip_driver map_absent_chipdrv = {
- probe: map_absent_probe,
- destroy: map_absent_destroy,
- name: "map_absent",
- module: THIS_MODULE
+ .probe = map_absent_probe,
+ .destroy = map_absent_destroy,
+ .name = "map_absent",
+ .module = THIS_MODULE
};
static struct mtd_info *map_absent_probe(struct map_info *map)
@@ -65,7 +66,7 @@ static struct mtd_info *map_absent_probe(struct map_info *map)
mtd->flags = 0;
mtd->erasesize = PAGE_SIZE;
- MOD_INC_USE_COUNT;
+ __module_get(THIS_MODULE);
return mtd;
}
@@ -79,7 +80,7 @@ static int map_absent_read(struct mtd_info *mtd, loff_t from, size_t len, size_t
static int map_absent_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{
*retlen = 0;
- return -ENODEV;
+ return -ENODEV;
}
static int map_absent_erase(struct mtd_info *mtd, struct erase_info *instr)
@@ -97,7 +98,7 @@ static void map_absent_destroy(struct mtd_info *mtd)
/* nop */
}
-int __init map_absent_init(void)
+static int __init map_absent_init(void)
{
register_mtd_chip_driver(&map_absent_chipdrv);
return 0;