]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - fs/cramfs/cramfs.c
Kconfig: add Kconfig option for MXS_MMC
[karo-tx-uboot.git] / fs / cramfs / cramfs.c
index f02bf3c744263121f4f8feaa66446fa97e731e3f..fd8e4ef31e6b7c42d589b3a62726ebbc025ceccc 100644 (file)
@@ -26,9 +26,6 @@
 
 #include <common.h>
 #include <malloc.h>
-
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
-
 #include <asm/byteorder.h>
 #include <linux/stat.h>
 #include <jffs2/jffs2.h>
@@ -44,8 +41,13 @@ struct cramfs_super super;
 
 /* CPU address space offset calculation macro, struct part_info offset is
  * device address space offset, so we need to shift it by a device start address. */
-extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
-#define PART_OFFSET(x) (x->offset + flash_info[x->dev->id->num].start[0])
+#if !defined(CONFIG_SYS_NO_FLASH)
+extern flash_info_t flash_info[];
+#define PART_OFFSET(x) ((ulong)x->offset + \
+                        flash_info[x->dev->id->num].start[0])
+#else
+#define PART_OFFSET(x) ((ulong)x->offset)
+#endif
 
 static int cramfs_read_super (struct part_info *info)
 {
@@ -125,7 +127,8 @@ static unsigned long cramfs_resolve (unsigned long begin, unsigned long offset,
                        namelen--;
                }
 
-               if (!strncmp (filename, name, namelen)) {
+               if (!strncmp(filename, name, namelen) &&
+                   (namelen == strlen(filename))) {
                        char *p = strtok (NULL, "/");
 
                        if (raw && (p == NULL || *p == '\0'))
@@ -343,5 +346,3 @@ int cramfs_check (struct part_info *info)
        }
        return 1;
 }
-
-#endif /* CFG_FS_CRAMFS */