#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/kmod.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include "mtdcore.h"
static inline void free_partition(struct mtd_info *mtd)
{ … }
void release_mtd_partition(struct mtd_info *mtd)
{ … }
static struct mtd_info *allocate_partition(struct mtd_info *parent,
const struct mtd_partition *part,
int partno, uint64_t cur_offset)
{ … }
static ssize_t offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(offset);
static const struct attribute *mtd_partition_attrs[] = …;
static int mtd_add_partition_attrs(struct mtd_info *new)
{ … }
int mtd_add_partition(struct mtd_info *parent, const char *name,
long long offset, long long length)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __mtd_del_partition(struct mtd_info *mtd)
{ … }
static int __del_mtd_partitions(struct mtd_info *mtd)
{ … }
int del_mtd_partitions(struct mtd_info *mtd)
{ … }
int mtd_del_partition(struct mtd_info *mtd, int partno)
{ … }
EXPORT_SYMBOL_GPL(…);
int add_mtd_partitions(struct mtd_info *parent,
const struct mtd_partition *parts,
int nbparts)
{ … }
static DEFINE_SPINLOCK(part_parser_lock);
static LIST_HEAD(part_parsers);
static struct mtd_part_parser *mtd_part_parser_get(const char *name)
{ … }
static inline void mtd_part_parser_put(const struct mtd_part_parser *p)
{ … }
static void mtd_part_parser_cleanup_default(const struct mtd_partition *pparts,
int nr_parts)
{ … }
int __register_mtd_parser(struct mtd_part_parser *p, struct module *owner)
{ … }
EXPORT_SYMBOL_GPL(…);
void deregister_mtd_parser(struct mtd_part_parser *p)
{ … }
EXPORT_SYMBOL_GPL(…);
static const char * const default_mtd_part_types[] = …;
static const char * const default_subpartition_types[] = …;
static int mtd_part_do_parse(struct mtd_part_parser *parser,
struct mtd_info *master,
struct mtd_partitions *pparts,
struct mtd_part_parser_data *data)
{ … }
static struct mtd_part_parser *mtd_part_get_compatible_parser(const char *compat)
{ … }
static int mtd_part_of_parse(struct mtd_info *master,
struct mtd_partitions *pparts)
{ … }
int parse_mtd_partitions(struct mtd_info *master, const char *const *types,
struct mtd_part_parser_data *data)
{ … }
void mtd_part_parser_cleanup(struct mtd_partitions *parts)
{ … }
uint64_t mtd_get_device_size(const struct mtd_info *mtd)
{ … }
EXPORT_SYMBOL_GPL(…);