]> git.sur5r.net Git - u-boot/blobdiff - fs/fat/file.c
Merge branch 'next' of git://git.denx.de/u-boot-mpc83xx
[u-boot] / fs / fat / file.c
index 514dbaecba8129bdb62c318ee7ac281530aacccd..d910c46ddb159d5cf43a009f0d9248b5cd9768b2 100644 (file)
@@ -6,23 +6,7 @@
  * 2002-07-28 - rjones@nexus-tech.net - ported to ppcboot v1.1.6
  * 2003-03-10 - kharris@nexus-tech.net - ported to uboot
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -32,8 +16,6 @@
 #include <linux/stat.h>
 #include <linux/time.h>
 
-#if defined(CONFIG_CMD_FAT)
-
 /* Supported filesystems */
 static const struct filesystem filesystems[] = {
        { file_fat_detectfs,  file_fat_ls,  file_fat_read,  "FAT" },
@@ -50,12 +32,12 @@ char file_cwd[CWD_LEN+1] = "/";
 const char *
 file_getfsname(int idx)
 {
-       if (idx < 0 || idx >= NUM_FILESYS) return NULL;
+       if (idx < 0 || idx >= NUM_FILESYS)
+               return NULL;
 
        return filesystems[idx].name;
 }
 
-
 static void
 pathcpy(char *dest, const char *src)
 {
@@ -74,15 +56,14 @@ pathcpy(char *dest, const char *src)
                        return;
                }
                ++dest;
-               if (ISDIRDELIM(*src)) {
+
+               if (ISDIRDELIM(*src))
                        while (ISDIRDELIM(*src)) src++;
-               } else {
+               else
                        src++;
-               }
        } while (1);
 }
 
-
 int
 file_cd(const char *path)
 {
@@ -143,7 +124,6 @@ file_cd(const char *path)
        return 0;
 }
 
-
 int
 file_detectfs(void)
 {
@@ -162,7 +142,6 @@ file_detectfs(void)
        return current_filesystem;
 }
 
-
 int
 file_ls(const char *dir)
 {
@@ -183,7 +162,6 @@ file_ls(const char *dir)
        return filesystems[current_filesystem].ls(arg);
 }
 
-
 long
 file_read(const char *filename, void *buffer, unsigned long maxsize)
 {
@@ -204,5 +182,3 @@ file_read(const char *filename, void *buffer, unsigned long maxsize)
 
        return filesystems[current_filesystem].read(arg, buffer, maxsize);
 }
-
-#endif