fat: change the location of fattable command code
authorDonggeun Kim <dg77.kim@samsung.com>
Mon, 20 Dec 2010 08:55:26 +0000 (17:55 +0900)
committerDonggeun Kim <dg77.kim@samsung.com>
Mon, 20 Dec 2010 08:55:26 +0000 (17:55 +0900)
Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
common/cmd_fat.c
fs/fat/fat_write.c

index af78f5e..a28cfb3 100644 (file)
@@ -185,45 +185,3 @@ U_BOOT_CMD(
        "    - print information about filesystem from 'dev' on 'interface'"
 );
 
-int do_fat_table (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       int dev = 0;
-       int part = 1;
-       char *ep;
-       block_dev_desc_t *dev_desc=NULL;
-
-       if (argc < 2) {
-               printf("usage: fattable <interface> <dev[:part]>\n");
-               return 0;
-       }
-       dev = (int)simple_strtoul(argv[2], &ep, 16);
-       dev_desc = get_dev(argv[1], dev);
-       if (dev_desc == NULL) {
-               puts("\n** Invalid boot device **\n");
-               return 1;
-       }
-       if (*ep) {
-               if (*ep != ':') {
-                       puts("\n** Invalid boot device, use `dev[:part]' **\n");
-                       return 1;
-               }
-               part = (int)simple_strtoul(++ep, NULL, 16);
-       }
-       if (fat_register_device(dev_desc,part)!=0) {
-               printf("\n** Unable to use %s %d:%d for fattable **\n",
-                       argv[1], dev, part);
-               return 1;
-       }
-
-       file_fat_table();
-
-       return 0;
-}
-
-U_BOOT_CMD(
-       fattable,       3,      1,      do_fat_table,
-       "print fat range of files ",
-       "<interface> <dev[:part]>\n"
-       "    - list files from 'dev' on 'interface' in a 'directory'"
-);
-
index 1f0b1b3..d68e7a6 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <config.h>
 #include <fat.h>
 #include <asm/byteorder.h>
@@ -1269,3 +1270,46 @@ void file_fat_table (void)
        find_directory_entry(mydata, startsect,
                                "", dentptr, 0, 1, 1);
 }
+
+int do_fat_table (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       int dev = 0;
+       int part = 1;
+       char *ep;
+       block_dev_desc_t *dev_desc=NULL;
+
+       if (argc < 2) {
+               printf("usage: fattable <interface> <dev[:part]>\n");
+               return 0;
+       }
+       dev = (int)simple_strtoul(argv[2], &ep, 16);
+       dev_desc = get_dev(argv[1], dev);
+       if (dev_desc == NULL) {
+               puts("\n** Invalid boot device **\n");
+               return 1;
+       }
+       if (*ep) {
+               if (*ep != ':') {
+                       puts("\n** Invalid boot device, use `dev[:part]' **\n");
+                       return 1;
+               }
+               part = (int)simple_strtoul(++ep, NULL, 16);
+       }
+       if (fat_register_device(dev_desc,part)!=0) {
+               printf("\n** Unable to use %s %d:%d for fattable **\n",
+                       argv[1], dev, part);
+               return 1;
+       }
+
+       file_fat_table();
+
+       return 0;
+}
+
+U_BOOT_CMD(
+       fattable,       3,      1,      do_fat_table,
+       "print fat range of files ",
+       "<interface> <dev[:part]>\n"
+       "    - list files from 'dev' on 'interface' in a 'directory'"
+);
+