Skip to content

Commit eea72d5

Browse files
jamieilesDavid Woodhouse
authored andcommitted
mtd: remove add_mtd_partitions, add_mtd_device and friends
These symbols are replaced with mtd_device_register() (and removal with mtd_device_unregister()) for public registration. Signed-off-by: Jamie Iles <jamie@jamieiles.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent ee0e87b commit eea72d5

5 files changed

Lines changed: 9 additions & 17 deletions

File tree

‎drivers/mtd/mtdcore.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ int add_mtd_device(struct mtd_info *mtd)
393393
* if the requested device does not appear to be present in the list.
394394
*/
395395

396-
int del_mtd_device (struct mtd_info *mtd)
396+
int del_mtd_device(struct mtd_info *mtd)
397397
{
398398
int ret;
399399
struct mtd_notifier *not;
@@ -723,8 +723,6 @@ void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size)
723723
return kmalloc(*size, GFP_KERNEL);
724724
}
725725

726-
EXPORT_SYMBOL_GPL(add_mtd_device);
727-
EXPORT_SYMBOL_GPL(del_mtd_device);
728726
EXPORT_SYMBOL_GPL(get_mtd_device);
729727
EXPORT_SYMBOL_GPL(get_mtd_device_nm);
730728
EXPORT_SYMBOL_GPL(__get_mtd_device);

‎drivers/mtd/mtdcore.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
extern struct mutex mtd_table_mutex;
1111
extern struct mtd_info *__mtd_next_device(int i);
1212

13+
extern int add_mtd_device(struct mtd_info *mtd);
14+
extern int del_mtd_device(struct mtd_info *mtd);
15+
extern int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *,
16+
int);
17+
extern int del_mtd_partitions(struct mtd_info *);
18+
1319
#define mtd_for_each_device(mtd) \
1420
for ((mtd) = __mtd_next_device(0); \
1521
(mtd) != NULL; \

‎drivers/mtd/mtdpart.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include <linux/mtd/partitions.h>
3232
#include <linux/err.h>
3333

34+
#include "mtdcore.h"
35+
3436
/* Our partition linked list */
3537
static LIST_HEAD(mtd_partitions);
3638
static DEFINE_MUTEX(mtd_partitions_mutex);
@@ -376,7 +378,6 @@ int del_mtd_partitions(struct mtd_info *master)
376378

377379
return err;
378380
}
379-
EXPORT_SYMBOL(del_mtd_partitions);
380381

381382
static struct mtd_part *allocate_partition(struct mtd_info *master,
382383
const struct mtd_partition *part, int partno,
@@ -671,7 +672,6 @@ int add_mtd_partitions(struct mtd_info *master,
671672

672673
return 0;
673674
}
674-
EXPORT_SYMBOL(add_mtd_partitions);
675675

676676
static DEFINE_SPINLOCK(part_parser_lock);
677677
static LIST_HEAD(part_parsers);

‎include/linux/mtd/mtd.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,6 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd)
322322

323323
/* Kernel-side ioctl definitions */
324324

325-
extern int add_mtd_device(struct mtd_info *mtd);
326-
extern int del_mtd_device (struct mtd_info *mtd);
327-
328325
struct mtd_partition;
329326

330327
extern int mtd_device_register(struct mtd_info *master,

‎include/linux/mtd/partitions.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ struct mtd_partition {
4949

5050
struct mtd_info;
5151

52-
int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
53-
int del_mtd_partitions(struct mtd_info *);
54-
5552
/*
5653
* Functions dealing with the various ways of partitioning the space
5754
*/
@@ -86,12 +83,6 @@ static inline int of_mtd_parse_partitions(struct device *dev,
8683
}
8784
#endif
8885

89-
#ifdef CONFIG_MTD_PARTITIONS
90-
static inline int mtd_has_partitions(void) { return 1; }
91-
#else
92-
static inline int mtd_has_partitions(void) { return 0; }
93-
#endif
94-
9586
#ifdef CONFIG_MTD_CMDLINE_PARTS
9687
static inline int mtd_has_cmdlinepart(void) { return 1; }
9788
#else

0 commit comments

Comments
 (0)