Release 4.7 drivers/mtd/chips/map_absent.c
  
  
/*
 * Common code to handle absent "placeholder" devices
 * Copyright 2001 Resilience Corporation <ebrower@resilience.com>
 *
 * 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
 * registration of MTD device nodes regardless of probe outcome.
 * A usage example is as follows:
 *
 *              my_dev[i] = do_map_probe("cfi", &my_map[i]);
 *              if(NULL == my_dev[i]) {
 *                      my_dev[i] = do_map_probe("map_absent", &my_map[i]);
 *              }
 *
 * Any device 'probed' with this driver will return -ENODEV
 * upon open.
 */
#include <linux/module.h>
#include <linux/types.h>
#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>
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 *);
static int map_absent_erase (struct mtd_info *, struct erase_info *);
static void map_absent_sync (struct mtd_info *);
static struct mtd_info *map_absent_probe(struct map_info *map);
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
};
static struct mtd_info *map_absent_probe(struct map_info *map)
{
	struct mtd_info *mtd;
	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
	if (!mtd) {
		return NULL;
	}
	map->fldrv 	= &map_absent_chipdrv;
	mtd->priv 	= map;
	mtd->name 	= map->name;
	mtd->type 	= MTD_ABSENT;
	mtd->size 	= map->size;
	mtd->_erase 	= map_absent_erase;
	mtd->_read 	= map_absent_read;
	mtd->_write 	= map_absent_write;
	mtd->_sync 	= map_absent_sync;
	mtd->flags 	= 0;
	mtd->erasesize  = PAGE_SIZE;
	mtd->writesize  = 1;
	__module_get(THIS_MODULE);
	return mtd;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| linus torvalds | linus torvalds | 111 | 88.10% | 1 | 20.00% | 
| artem bityutskiy | artem bityutskiy | 10 | 7.94% | 2 | 40.00% | 
| david woodhouse | david woodhouse | 4 | 3.17% | 1 | 20.00% | 
| burman yan | burman yan | 1 | 0.79% | 1 | 20.00% | 
 | Total | 126 | 100.00% | 5 | 100.00% | 
static int map_absent_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
{
	return -ENODEV;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| linus torvalds | linus torvalds | 29 | 100.00% | 1 | 100.00% | 
 | Total | 29 | 100.00% | 1 | 100.00% | 
static int map_absent_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{
	return -ENODEV;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| linus torvalds | linus torvalds | 30 | 100.00% | 1 | 100.00% | 
 | Total | 30 | 100.00% | 1 | 100.00% | 
static int map_absent_erase(struct mtd_info *mtd, struct erase_info *instr)
{
	return -ENODEV;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| linus torvalds | linus torvalds | 20 | 100.00% | 1 | 100.00% | 
 | Total | 20 | 100.00% | 1 | 100.00% | 
static void map_absent_sync(struct mtd_info *mtd)
{
	/* nop */
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| linus torvalds | linus torvalds | 12 | 100.00% | 1 | 100.00% | 
 | Total | 12 | 100.00% | 1 | 100.00% | 
static void map_absent_destroy(struct mtd_info *mtd)
{
	/* nop */
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| linus torvalds | linus torvalds | 12 | 100.00% | 1 | 100.00% | 
 | Total | 12 | 100.00% | 1 | 100.00% | 
static int __init map_absent_init(void)
{
	register_mtd_chip_driver(&map_absent_chipdrv);
	return 0;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| linus torvalds | linus torvalds | 17 | 94.44% | 1 | 50.00% | 
| david woodhouse | david woodhouse | 1 | 5.56% | 1 | 50.00% | 
 | Total | 18 | 100.00% | 2 | 100.00% | 
static void __exit map_absent_exit(void)
{
	unregister_mtd_chip_driver(&map_absent_chipdrv);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| linus torvalds | linus torvalds | 15 | 100.00% | 1 | 100.00% | 
 | Total | 15 | 100.00% | 1 | 100.00% | 
module_init(map_absent_init);
module_exit(map_absent_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Resilience Corporation - Eric Brower <ebrower@resilience.com>");
MODULE_DESCRIPTION("Placeholder MTD chip driver for 'absent' chips");
Overall Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| linus torvalds | linus torvalds | 390 | 92.64% | 1 | 12.50% | 
| david woodhouse | david woodhouse | 11 | 2.61% | 2 | 25.00% | 
| artem bityutskiy | artem bityutskiy | 10 | 2.38% | 2 | 25.00% | 
| art haas | art haas | 8 | 1.90% | 1 | 12.50% | 
| burman yan | burman yan | 1 | 0.24% | 1 | 12.50% | 
| adrian bunk | adrian bunk | 1 | 0.24% | 1 | 12.50% | 
 | Total | 421 | 100.00% | 8 | 100.00% | 
  
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.