mtd: drop mtd_device_register

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Nov 7 11:59:23 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=15c60a508ab3393e68b7ccb3528981ccacf9c0f9
Commit:     15c60a508ab3393e68b7ccb3528981ccacf9c0f9
Parent:     953b3bd1911260b8acd8f35fa26440c1a943e59a
Author:     Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
AuthorDate: Thu Jun 23 15:33:15 2011 +0400
Committer:  Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:02:13 2011 +0300

    mtd: drop mtd_device_register
    
    mtd_device_register() is a limited version of mtd_device_parse_register.
    Replace it with macro calling mtd_device_parse_register().
    
    Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
 drivers/mtd/mtdcore.c   |   23 -----------------------
 include/linux/mtd/mtd.h |    5 ++---
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index e186399..f9cc2d2 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -429,29 +429,6 @@ out_error:
 }
 
 /**
- * mtd_device_register - register an MTD device.
- *
- * @master: the MTD device to register
- * @parts: the partitions to register - only valid if nr_parts > 0
- * @nr_parts: the number of partitions in parts.  If zero then the full MTD
- *            device is registered
- *
- * Register an MTD device with the system and optionally, a number of
- * partitions.  If nr_parts is 0 then the whole device is registered, otherwise
- * only the partitions are registered.  To register both the full device *and*
- * the partitions, call mtd_device_register() twice, once with nr_parts == 0
- * and once equal to the number of partitions.
- */
-int mtd_device_register(struct mtd_info *master,
-			const struct mtd_partition *parts,
-			int nr_parts)
-{
-	return parts ? add_mtd_partitions(master, parts, nr_parts) :
-		add_mtd_device(master);
-}
-EXPORT_SYMBOL_GPL(mtd_device_register);
-
-/**
  * mtd_device_parse_register - parse partitions and register an MTD device.
  *
  * @mtd: the MTD device to register
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index b2b454b..67774f9 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -325,14 +325,13 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd)
 struct mtd_partition;
 struct mtd_part_parser_data;
 
-extern int mtd_device_register(struct mtd_info *master,
-			       const struct mtd_partition *parts,
-			       int nr_parts);
 extern int mtd_device_parse_register(struct mtd_info *mtd,
 			      const char **part_probe_types,
 			      struct mtd_part_parser_data *parser_data,
 			      const struct mtd_partition *defparts,
 			      int defnr_parts);
+#define mtd_device_register(master, parts, nr_parts)	\
+	mtd_device_parse_register(master, NULL, NULL, parts, nr_parts)
 extern int mtd_device_unregister(struct mtd_info *master);
 extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
 extern int __get_mtd_device(struct mtd_info *mtd);



More information about the linux-mtd-cvs mailing list