linux/drivers/mtd/chips/map_absent.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Common code to handle absent "placeholder" devices
 * Copyright 2001 Resilience Corporation <[email protected]>
 *
 * 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 =;

static struct mtd_info *map_absent_probe(struct map_info *map)
{}


static int map_absent_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
{}

static int map_absent_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{}

static int map_absent_erase(struct mtd_info *mtd, struct erase_info *instr)
{}

static void map_absent_sync(struct mtd_info *mtd)
{}

static void map_absent_destroy(struct mtd_info *mtd)
{}

static int __init map_absent_init(void)
{}

static void __exit map_absent_exit(void)
{}

module_init();
module_exit(map_absent_exit);

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();