linux/drivers/mtd/devices/block2mtd.c

/*
 * block2mtd.c - create an mtd from a block device
 *
 * Copyright (C) 2001,2002	Simon Evans <[email protected]>
 * Copyright (C) 2004-2006	Joern Engel <[email protected]>
 *
 * Licence: GPL
 */

#define pr_fmt(fmt)

/*
 * When the first attempt at device initialization fails, we may need to
 * wait a little bit and retry. This timeout, by default 3 seconds, gives
 * device time to start up. Required on BCM2708 and a few other chipsets.
 */
#define MTD_DEFAULT_TIMEOUT

#include <linux/module.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <linux/bio.h>
#include <linux/pagemap.h>
#include <linux/list.h>
#include <linux/init.h>
#include <linux/mtd/mtd.h>
#include <linux/mutex.h>
#include <linux/mount.h>
#include <linux/slab.h>
#include <linux/major.h>

/* Maximum number of comma-separated items in the 'block2mtd=' parameter */
#define BLOCK2MTD_PARAM_MAX_COUNT

/* Info for the block device */
struct block2mtd_dev {};


/* Static info about the MTD, used in cleanup_module */
static LIST_HEAD(blkmtd_device_list);


static struct page *page_read(struct address_space *mapping, pgoff_t index)
{}

/* erase a specified part of the device */
static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t to, size_t len)
{}
static int block2mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
{}


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


/* write data to the underlying device */
static int _block2mtd_write(struct block2mtd_dev *dev, const u_char *buf,
		loff_t to, size_t len, size_t *retlen)
{}


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


/* sync the device - wait until the write queue is empty */
static void block2mtd_sync(struct mtd_info *mtd)
{}


static void block2mtd_free_device(struct block2mtd_dev *dev)
{}

/*
 * This function is marked __ref because it calls the __init marked
 * early_lookup_bdev when called from the early boot code.
 */
static struct file __ref *mdtblock_early_get_bdev(const char *devname,
		blk_mode_t mode, int timeout, struct block2mtd_dev *dev)
{}

static struct block2mtd_dev *add_device(char *devname, int erase_size,
		char *label, int timeout)
{}


/* This function works similar to reguler strtoul.  In addition, it
 * allows some suffixes for a more human-readable number format:
 * ki, Ki, kiB, KiB	- multiply result with 1024
 * Mi, MiB		- multiply result with 1024^2
 * Gi, GiB		- multiply result with 1024^3
 */
static int ustrtoul(const char *cp, char **endp, unsigned int base)
{}


static int parse_num(size_t *num, const char *token)
{}


static inline void kill_final_newline(char *str)
{}


#ifndef MODULE
static int block2mtd_init_called =;
/* 80 for device, 12 for erase size */
static char block2mtd_paramline[80 + 12];
#endif

static int block2mtd_setup2(const char *val)
{}


static int block2mtd_setup(const char *val, const struct kernel_param *kp)
{}


module_param_call();
MODULE_PARM_DESC();

static int __init block2mtd_init(void)
{}


static void block2mtd_exit(void)
{}

late_initcall(block2mtd_init);
module_exit(block2mtd_exit);

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