Skip to contentSkip to conversation

MTD: Cleanup jffs2/mtdpart headers

PATCH New Stefan Roese 2 participants 2 messages Aug 12, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD: Cleanup jffs2/mtdpart headers

This patch moves some MTD related defines and prototypes from a jffs2 header to an MTD header. This makes it possible to remove this jffs2 header inclusion from some files without jffs2 relevance.

Cc Alexander Stein <[email protected]>
---
 board/sixnet/sixnet.c        |    1 -
 common/cmd_flash.c           |   11 +---------
 common/cmd_jffs2.c           |    2 +-
 common/cmd_nand.c            |   10 ---------
 drivers/mtd/nand/nand_base.c |    4 ---
 include/jffs2/jffs2.h        |    1 +
 include/jffs2/load_kernel.h  |   43 -----------------------------------------
 include/linux/mtd/mtd.h      |   44 ++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 47 insertions(+), 69 deletions(-)
board/sixnet/sixnet.c +0 -1
index edb5d13..b30c01b 100644
@@ -24,7 +24,6 @@
 
 #include <common.h>
 #include <config.h>
-#include <jffs2/jffs2.h>
 #include <mpc8xx.h>
 #include <net.h>	/* for eth_init() */
 #include <rtc.h>
common/cmd_flash.c +1 -10
index 3e6bab2..abb4a57 100644
@@ -26,21 +26,12 @@
  */
 #include <common.h>
 #include <command.h>
+#include <linux/mtd/mtd.h>
 
 #ifdef CONFIG_HAS_DATAFLASH
 #include <dataflash.h>
 #endif
 
-#if defined(CONFIG_CMD_MTDPARTS)
-#include <jffs2/jffs2.h>
-
-/* partition handling routines */
-int mtdparts_init(void);
-int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num);
-int find_dev_and_part(const char *id, struct mtd_device **dev,
-		u8 *part_num, struct part_info **part);
-#endif
-
 #ifndef CONFIG_SYS_NO_FLASH
 extern flash_info_t flash_info[];	/* info for FLASH chips */
 
common/cmd_jffs2.c +1 -1
index 0e7a6b0..b599cc7 100644
@@ -215,7 +215,7 @@ static int mtd_device_validate(u8 type, u8 num, u32 *size)
  * @param dev_num parsed device number (output)
  * @return 0 on success, 1 otherwise
  */
-static int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
+int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
 {
 	const char *p = id;
 
common/cmd_nand.c +0 -10
index 3f1d077..7e861f6 100644
@@ -18,18 +18,8 @@
 #include <watchdog.h>
 #include <malloc.h>
 #include <asm/byteorder.h>
-#include <jffs2/jffs2.h>
 #include <nand.h>
 
-#if defined(CONFIG_CMD_MTDPARTS)
-
-/* partition handling routines */
-int mtdparts_init(void);
-int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num);
-int find_dev_and_part(const char *id, struct mtd_device **dev,
-		      u8 *part_num, struct part_info **part);
-#endif
-
 static int nand_dump(nand_info_t *nand, ulong off, int only_oob)
 {
 	int i;
drivers/mtd/nand/nand_base.c +0 -4
index ed1c9c9..d60059c 100644
@@ -75,10 +75,6 @@
 #include <asm/io.h>
 #include <asm/errno.h>
 
-#ifdef CONFIG_JFFS2_NAND
-#include <jffs2/jffs2.h>
-#endif
-
 /*
  * CONFIG_SYS_NAND_RESET_CNT is used as a timeout mechanism when resetting
  * a flash.  NAND flash is initialized prior to interrupts so standard timers
include/jffs2/jffs2.h +1 -0
index 651f94c..1a7b50e 100644
@@ -39,6 +39,7 @@
 #define __LINUX_JFFS2_H__
 
 #include <asm/types.h>
+#include <linux/mtd/mtd.h>
 #include <jffs2/load_kernel.h>
 
 #define JFFS2_SUPER_MAGIC 0x72b6
include/jffs2/load_kernel.h +0 -43

53 lines not on this page · raw message

include/linux/mtd/mtd.h +44 -0

62 lines not on this page · raw message

Signature · 1 line
1.7.2.1
#1 lore raw

PATCH 1/1 MTD: Cleanup jffs2/mtdpart headers

Quoted 6 lines · Stefan Roese

This patch moves some MTD related defines and prototypes from a jffs2 header to an MTD header. This makes it possible to remove this jffs2 header inclusion from some files without jffs2 relevance.

Cc Alexander Stein<[email protected]>

Just two comments.

include/linux/mtd/mtd.h line 48

Quoted 7 lines
include/linux/mtd/mtd.h +7 -0
+struct part_info {
+	struct list_head link;
+	char *name;			/* partition name */
+	u8 auto_name;			/* set to 1 for generated name */
+	u32 size;			/* total size of the partition */
+	u32 offset;			/* offset within device */
+	void *jffs2_priv;		/* used internaly by jffs2 */

Should this really be in here? Seems we are mixing things up still.

Quoted 3 lines
  /* XXX U-BOOT XXX */
  #if 0
  struct mtd_notifier {

What's up with "#if 0" code in the src?

Rogan