[MTD] DiskOnChip: big endian fix for NFTL devices
authorThomas Gleixner <tglx@linutronix.de>
Mon, 31 Jan 2005 22:22:24 +0000 (22:22 +0000)
committerThomas Gleixner <tglx@mtd.linutronix.de>
Mon, 23 May 2005 10:18:59 +0000 (12:18 +0200)
Make NFTL devices work on big endian machines.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/mtd/nand/diskonchip.c

index 3922401..d592767 100644 (file)
@@ -16,7 +16,7 @@
  *  
  * Interface to generic NAND code for M-Systems DiskOnChip devices
  *
- * $Id: diskonchip.c,v 1.47 2005/01/31 22:21:15 gleixner Exp $
+ * $Id: diskonchip.c,v 1.48 2005/01/31 22:22:21 gleixner Exp $
  */
 
 #include <linux/kernel.h>
@@ -1122,6 +1122,10 @@ static inline int __init nftl_partscan(struct mtd_info *mtd,
        if (!(numheaders=find_media_headers(mtd, buf, "ANAND", 1))) goto out;
        mh = (struct NFTLMediaHeader *) buf;
 
+       mh->NumEraseUnits = le16_to_cpu(mh->NumEraseUnits);
+       mh->FirstPhysicalEUN = le16_to_cpu(mh->FirstPhysicalEUN);
+       mh->FormattedSize = le32_to_cpu(mh->FormattedSize);
+
        printk(KERN_INFO "    DataOrgID        = %s\n"
                         "    NumEraseUnits    = %d\n"
                         "    FirstPhysicalEUN = %d\n"