--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -1118,6 +1118,62 @@ void mtd_part_parser_cleanup(struct mtd_
+@@ -56,6 +56,10 @@ struct mtd_part {
+ };
+
+ static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part);
++static int parse_mtd_partitions_by_type(struct mtd_info *master,
++ enum mtd_parser_type type,
++ const struct mtd_partition **pparts,
++ struct mtd_part_parser_data *data);
+
+ /*
+ * Given a pointer to the MTD object in the mtd_part structure, we can retrieve
+@@ -1118,6 +1122,61 @@ void mtd_part_parser_cleanup(struct mtd_
}
}
+ return ret;
+}
+
-+int parse_mtd_partitions_by_type(struct mtd_info *master,
-+ enum mtd_parser_type type,
-+ const struct mtd_partition **pparts,
-+ struct mtd_part_parser_data *data)
++static int parse_mtd_partitions_by_type(struct mtd_info *master,
++ enum mtd_parser_type type,
++ const struct mtd_partition **pparts,
++ struct mtd_part_parser_data *data)
+{
+ struct mtd_part_parser *prev = NULL;
+ int ret = 0;
+
+ return ret;
+}
-+EXPORT_SYMBOL_GPL(parse_mtd_partitions_by_type);
+
int mtd_is_partition(const struct mtd_info *mtd)
{
struct mtd_part *part;
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
-@@ -68,11 +68,14 @@ struct mtd_part_parser_data {
- unsigned long origin;
- };
-
--
- /*
+@@ -73,6 +73,10 @@ struct mtd_part_parser_data {
* Functions dealing with the various ways of partitioning the space
*/
struct mtd_part_parser {
struct list_head list;
struct module *owner;
-@@ -81,6 +84,7 @@ struct mtd_part_parser {
+@@ -81,6 +85,7 @@ struct mtd_part_parser {
int (*parse_fn)(struct mtd_info *, const struct mtd_partition **,
struct mtd_part_parser_data *);
void (*cleanup)(const struct mtd_partition *pparts, int nr_parts);
};
/* Container for passing around a set of parsed partitions */
-@@ -113,4 +117,9 @@ uint64_t mtd_get_device_size(const struc
- extern void __weak arch_split_mtd_part(struct mtd_info *master,
- const char *name, int offset, int size);
-
-+int parse_mtd_partitions_by_type(struct mtd_info *master,
-+ enum mtd_parser_type type,
-+ const struct mtd_partition **pparts,
-+ struct mtd_part_parser_data *data);
-+
- #endif
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -741,6 +741,36 @@ int mtd_del_partition(struct mtd_info *m
+@@ -745,6 +745,36 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME
#else
-@@ -749,6 +779,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
+@@ -753,6 +783,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
static void split_firmware(struct mtd_info *master, struct mtd_part *part)
{
}
void __weak arch_split_mtd_part(struct mtd_info *master, const char *name,
-@@ -763,6 +794,12 @@ static void mtd_partition_split(struct m
+@@ -767,6 +798,12 @@ static void mtd_partition_split(struct m
if (rootfs_found)
return;
split_firmware(master, part);
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
-@@ -74,6 +74,8 @@ struct mtd_part_parser_data {
+@@ -75,6 +75,8 @@ struct mtd_part_parser_data {
enum mtd_parser_type {
MTD_PARSER_TYPE_DEVICE = 0,
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -1228,6 +1228,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -1231,6 +1231,24 @@ int mtd_is_partition(const struct mtd_in
}
EXPORT_SYMBOL_GPL(mtd_is_partition);
if (mtd->writesize_shift)
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
-@@ -115,6 +115,8 @@ int mtd_is_partition(const struct mtd_in
+@@ -116,6 +116,8 @@ int mtd_is_partition(const struct mtd_in
int mtd_add_partition(struct mtd_info *master, const char *name,
long long offset, long long length);
int mtd_del_partition(struct mtd_info *master, int partno);
/* Our partition linked list */
static LIST_HEAD(mtd_partitions);
static DEFINE_MUTEX(mtd_partitions_mutex);
-@@ -242,13 +244,61 @@ static int part_erase(struct mtd_info *m
+@@ -246,13 +248,61 @@ static int part_erase(struct mtd_info *m
struct mtd_part *part = mtd_to_part(mtd);
int ret;
return ret;
}
-@@ -256,6 +306,25 @@ void mtd_erase_callback(struct erase_inf
+@@ -260,6 +310,25 @@ void mtd_erase_callback(struct erase_inf
{
if (instr->mtd->_erase == part_erase) {
struct mtd_part *part = mtd_to_part(instr->mtd);
if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
instr->fail_addr -= part->offset;
-@@ -570,19 +639,22 @@ static struct mtd_part *allocate_partiti
+@@ -574,19 +643,22 @@ static struct mtd_part *allocate_partiti
remainder = do_div(tmp, wr_alignment);
if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
/* Doesn't start on a boundary of major erase size */
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -344,7 +344,16 @@ static int part_lock(struct mtd_info *mt
+@@ -348,7 +348,16 @@ static int part_lock(struct mtd_info *mt
static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
{
struct mtd_part *part = mtd_to_part(mtd);
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -1115,6 +1115,62 @@ void mtd_part_parser_cleanup(struct mtd_
+@@ -56,6 +56,10 @@ struct mtd_part {
+ };
+
+ static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part);
++static int parse_mtd_partitions_by_type(struct mtd_info *master,
++ enum mtd_parser_type type,
++ const struct mtd_partition **pparts,
++ struct mtd_part_parser_data *data);
+
+ /*
+ * Given a pointer to the MTD object in the mtd_part structure, we can retrieve
+@@ -1115,6 +1119,61 @@ void mtd_part_parser_cleanup(struct mtd_
}
}
+ return ret;
+}
+
-+int parse_mtd_partitions_by_type(struct mtd_info *master,
-+ enum mtd_parser_type type,
-+ const struct mtd_partition **pparts,
-+ struct mtd_part_parser_data *data)
++static int parse_mtd_partitions_by_type(struct mtd_info *master,
++ enum mtd_parser_type type,
++ const struct mtd_partition **pparts,
++ struct mtd_part_parser_data *data)
+{
+ struct mtd_part_parser *prev = NULL;
+ int ret = 0;
+
+ return ret;
+}
-+EXPORT_SYMBOL_GPL(parse_mtd_partitions_by_type);
+
int mtd_is_partition(const struct mtd_info *mtd)
{
struct mtd_part *part;
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
-@@ -68,11 +68,14 @@ struct mtd_part_parser_data {
- unsigned long origin;
- };
-
--
- /*
+@@ -73,6 +73,10 @@ struct mtd_part_parser_data {
* Functions dealing with the various ways of partitioning the space
*/
struct mtd_part_parser {
struct list_head list;
struct module *owner;
-@@ -81,6 +84,7 @@ struct mtd_part_parser {
+@@ -81,6 +85,7 @@ struct mtd_part_parser {
int (*parse_fn)(struct mtd_info *, const struct mtd_partition **,
struct mtd_part_parser_data *);
void (*cleanup)(const struct mtd_partition *pparts, int nr_parts);
};
/* Container for passing around a set of parsed partitions */
-@@ -113,4 +117,9 @@ uint64_t mtd_get_device_size(const struc
- extern void __weak arch_split_mtd_part(struct mtd_info *master,
- const char *name, int offset, int size);
-
-+int parse_mtd_partitions_by_type(struct mtd_info *master,
-+ enum mtd_parser_type type,
-+ const struct mtd_partition **pparts,
-+ struct mtd_part_parser_data *data);
-+
- #endif
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -733,6 +733,36 @@ int mtd_del_partition(struct mtd_info *m
+@@ -737,6 +737,36 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME
#else
-@@ -741,6 +771,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
+@@ -745,6 +775,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
static void split_firmware(struct mtd_info *master, struct mtd_part *part)
{
}
void __weak arch_split_mtd_part(struct mtd_info *master, const char *name,
-@@ -755,6 +786,12 @@ static void mtd_partition_split(struct m
+@@ -759,6 +790,12 @@ static void mtd_partition_split(struct m
if (rootfs_found)
return;
split_firmware(master, part);
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
-@@ -74,6 +74,8 @@ struct mtd_part_parser_data {
+@@ -75,6 +75,8 @@ struct mtd_part_parser_data {
enum mtd_parser_type {
MTD_PARSER_TYPE_DEVICE = 0,
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -1225,6 +1225,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -1228,6 +1228,24 @@ int mtd_is_partition(const struct mtd_in
}
EXPORT_SYMBOL_GPL(mtd_is_partition);
if (mtd->writesize_shift)
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
-@@ -115,6 +115,8 @@ int mtd_is_partition(const struct mtd_in
+@@ -116,6 +116,8 @@ int mtd_is_partition(const struct mtd_in
int mtd_add_partition(struct mtd_info *master, const char *name,
long long offset, long long length);
int mtd_del_partition(struct mtd_info *master, int partno);
/* Our partition linked list */
static LIST_HEAD(mtd_partitions);
static DEFINE_MUTEX(mtd_partitions_mutex);
-@@ -242,13 +244,61 @@ static int part_erase(struct mtd_info *m
+@@ -246,13 +248,61 @@ static int part_erase(struct mtd_info *m
struct mtd_part *part = mtd_to_part(mtd);
int ret;
return ret;
}
-@@ -256,6 +306,25 @@ void mtd_erase_callback(struct erase_inf
+@@ -260,6 +310,25 @@ void mtd_erase_callback(struct erase_inf
{
if (instr->mtd->_erase == part_erase) {
struct mtd_part *part = mtd_to_part(instr->mtd);
if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
instr->fail_addr -= part->offset;
-@@ -562,19 +631,22 @@ static struct mtd_part *allocate_partiti
+@@ -566,19 +635,22 @@ static struct mtd_part *allocate_partiti
remainder = do_div(tmp, wr_alignment);
if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
/* Doesn't start on a boundary of major erase size */
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -344,7 +344,16 @@ static int part_lock(struct mtd_info *mt
+@@ -348,7 +348,16 @@ static int part_lock(struct mtd_info *mt
static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
{
struct mtd_part *part = mtd_to_part(mtd);