#define pr_fmt(fmt) …
#include <linux/io.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/mtd/mtd.h>
#include <asm/div64.h>
#include <linux/platform_device.h>
#include <linux/of_address.h>
#include <linux/of.h>
struct phram_mtd_list { … };
static LIST_HEAD(phram_list);
static int phram_erase(struct mtd_info *mtd, struct erase_info *instr)
{ … }
static int phram_point(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, void **virt, resource_size_t *phys)
{ … }
static int phram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
{ … }
static int phram_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
{ … }
static int phram_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{ … }
static int phram_map(struct phram_mtd_list *phram, phys_addr_t start, size_t len)
{ … }
static void phram_unmap(struct phram_mtd_list *phram)
{ … }
static void unregister_devices(void)
{ … }
static int register_device(struct platform_device *pdev, const char *name,
phys_addr_t start, size_t len, uint32_t erasesize)
{ … }
static int parse_num64(uint64_t *num64, char *token)
{ … }
static int parse_name(char **pname, const char *token)
{ … }
static inline void kill_final_newline(char *str)
{ … }
#define parse_err(fmt, args...) …
#ifndef MODULE
static int phram_init_called;
static char phram_paramline[64 + 20 + 20 + 20];
#endif
static int phram_setup(const char *val)
{ … }
static int phram_param_call(const char *val, const struct kernel_param *kp)
{ … }
module_param_call(…);
MODULE_PARM_DESC(…) …;
#ifdef CONFIG_OF
static const struct of_device_id phram_of_match[] = …;
MODULE_DEVICE_TABLE(of, phram_of_match);
#endif
static int phram_probe(struct platform_device *pdev)
{ … }
static void phram_remove(struct platform_device *pdev)
{ … }
static struct platform_driver phram_driver = …;
static int __init init_phram(void)
{ … }
static void __exit cleanup_phram(void)
{ … }
module_init(…) …;
module_exit(cleanup_phram);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;