Release 4.7 drivers/mtd/chips/map_rom.c
/*
* Common code to handle map devices which are simple ROM
* (C) 2000 Red Hat. GPL'd.
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <asm/io.h>
#include <asm/byteorder.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.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 *);
static struct mtd_info *map_rom_probe(struct map_info *map);
static int maprom_erase (struct mtd_info *mtd, struct erase_info *info);
static unsigned long maprom_unmapped_area(struct mtd_info *, unsigned long,
unsigned long, unsigned long);
static struct mtd_chip_driver maprom_chipdrv = {
.probe = map_rom_probe,
.name = "map_rom",
.module = THIS_MODULE
};
static unsigned int default_erasesize(struct map_info *map)
{
const __be32 *erase_size = NULL;
erase_size = of_get_property(map->device_node, "erase-size", NULL);
return !erase_size ? map->size : be32_to_cpu(*erase_size);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
aaron sierra | aaron sierra | 46 | 100.00% | 1 | 100.00% |
| Total | 46 | 100.00% | 1 | 100.00% |
static struct mtd_info *map_rom_probe(struct map_info *map)
{
struct mtd_info *mtd;
mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd)
return NULL;
map->fldrv = &maprom_chipdrv;
mtd->priv = map;
mtd->name = map->name;
mtd->type = MTD_ROM;
mtd->size = map->size;
mtd->_get_unmapped_area = maprom_unmapped_area;
mtd->_read = maprom_read;
mtd->_write = maprom_write;
mtd->_sync = maprom_nop;
mtd->_erase = maprom_erase;
mtd->flags = MTD_CAP_ROM;
mtd->erasesize = default_erasesize(map);
mtd->writesize = 1;
mtd->writebufsize = 1;
__module_get(THIS_MODULE);
return mtd;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 96 | 69.06% | 2 | 14.29% |
artem bityutskiy | artem bityutskiy | 11 | 7.91% | 2 | 14.29% |
aaron sierra | aaron sierra | 9 | 6.47% | 1 | 7.14% |
david woodhouse | david woodhouse | 6 | 4.32% | 3 | 21.43% |
alan cox | alan cox | 5 | 3.60% | 1 | 7.14% |
david howells | david howells | 5 | 3.60% | 1 | 7.14% |
linus torvalds | linus torvalds | 5 | 3.60% | 2 | 14.29% |
burman yan | burman yan | 1 | 0.72% | 1 | 7.14% |
joern engel | joern engel | 1 | 0.72% | 1 | 7.14% |
| Total | 139 | 100.00% | 14 | 100.00% |
/*
* Allow NOMMU mmap() to directly map the device (if not NULL)
* - return the address to which the offset maps
* - return -ENOSYS to indicate refusal to do the mapping
*/
static unsigned long maprom_unmapped_area(struct mtd_info *mtd,
unsigned long len,
unsigned long offset,
unsigned long flags)
{
struct map_info *map = mtd->priv;
return (unsigned long) map->virt + offset;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
david howells | david howells | 44 | 100.00% | 1 | 100.00% |
| Total | 44 | 100.00% | 1 | 100.00% |
static int maprom_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
{
struct map_info *map = mtd->priv;
map_copy_from(map, buf, from, len);
*retlen = len;
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 52 | 98.11% | 1 | 50.00% |
david woodhouse | david woodhouse | 1 | 1.89% | 1 | 50.00% |
| Total | 53 | 100.00% | 2 | 100.00% |
static void maprom_nop(struct mtd_info *mtd)
{
/* Nothing to see here */
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 12 | 100.00% | 1 | 100.00% |
| Total | 12 | 100.00% | 1 | 100.00% |
static int maprom_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{
return -EROFS;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 29 | 96.67% | 1 | 50.00% |
artem bityutskiy | artem bityutskiy | 1 | 3.33% | 1 | 50.00% |
| Total | 30 | 100.00% | 2 | 100.00% |
static int maprom_erase (struct mtd_info *mtd, struct erase_info *info)
{
/* We do our best 8) */
return -EROFS;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
alan cox | alan cox | 21 | 100.00% | 1 | 100.00% |
| Total | 21 | 100.00% | 1 | 100.00% |
static int __init map_rom_init(void)
{
register_mtd_chip_driver(&maprom_chipdrv);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 13 | 72.22% | 1 | 25.00% |
linus torvalds | linus torvalds | 4 | 22.22% | 2 | 50.00% |
david woodhouse | david woodhouse | 1 | 5.56% | 1 | 25.00% |
| Total | 18 | 100.00% | 4 | 100.00% |
static void __exit map_rom_exit(void)
{
unregister_mtd_chip_driver(&maprom_chipdrv);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 9 | 60.00% | 1 | 33.33% |
linus torvalds | linus torvalds | 6 | 40.00% | 2 | 66.67% |
| Total | 15 | 100.00% | 3 | 100.00% |
module_init(map_rom_init);
module_exit(map_rom_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
MODULE_DESCRIPTION("MTD chip driver for ROM chips");
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 295 | 53.25% | 2 | 11.11% |
david howells | david howells | 69 | 12.45% | 1 | 5.56% |
aaron sierra | aaron sierra | 58 | 10.47% | 1 | 5.56% |
linus torvalds | linus torvalds | 55 | 9.93% | 3 | 16.67% |
alan cox | alan cox | 41 | 7.40% | 1 | 5.56% |
david woodhouse | david woodhouse | 15 | 2.71% | 3 | 16.67% |
artem bityutskiy | artem bityutskiy | 12 | 2.17% | 3 | 16.67% |
art haas | art haas | 6 | 1.08% | 1 | 5.56% |
burman yan | burman yan | 1 | 0.18% | 1 | 5.56% |
adrian bunk | adrian bunk | 1 | 0.18% | 1 | 5.56% |
joern engel | joern engel | 1 | 0.18% | 1 | 5.56% |
| Total | 554 | 100.00% | 18 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.