tree 9da44daa876860644e06cbf0f3563eba63030f75
parent 97f1a087dc83cac54d740bf24888e565962b8f4d
author Ben Dooks <[EMAIL PROTECTED]> Tue, 18 Jan 2005 11:13:50 +0000
committer Thomas Gleixner <[EMAIL PROTECTED]> Mon, 23 May 2005 11:28:55 +0200

[MTD] bast-flash partitions fixup

Ensure the whole device is added if there are no partitions found on the
device, so that at least the flash can be read/written.

Replace some of the constants with their SZ_xxx counterparts

Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

 drivers/mtd/maps/bast-flash.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/maps/bast-flash.c b/drivers/mtd/maps/bast-flash.c
--- a/drivers/mtd/maps/bast-flash.c
+++ b/drivers/mtd/maps/bast-flash.c
@@ -1,14 +1,15 @@
 /* linux/drivers/mtd/maps/bast_flash.c
  *
- * Copyright (c) 2004 Simtec Electronics
- * Ben Dooks <[EMAIL PROTECTED]>
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     Ben Dooks <[EMAIL PROTECTED]>
  *
  * Simtec Bast (EB2410ITX) NOR MTD Mapping driver
  *
  * Changelog:
  *     20-Sep-2004  BJD  Initial version
+ *     17-Jan-2005  BJD  Add whole device if no partitions found
  *
- * $Id: bast-flash.c,v 1.1 2004/09/21 14:29:04 bjd Exp $
+ * $Id: bast-flash.c,v 1.2 2005/01/18 11:13:47 bjd Exp $
  *
  * 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
@@ -46,9 +47,9 @@
 #include <asm/arch/bast-cpld.h>
 
 #ifdef CONFIG_MTD_BAST_MAXSIZE
-#define AREA_MAXSIZE (CONFIG_MTD_BAST_MAXSIZE * (1024*1024))
+#define AREA_MAXSIZE (CONFIG_MTD_BAST_MAXSIZE * SZ_1M)
 #else
-#define AREA_MAXSIZE (32*1024*1024)
+#define AREA_MAXSIZE (32 * SZ_1M)
 #endif
 
 #define PFX "bast-flash: "
@@ -189,6 +190,8 @@ static int bast_flash_probe(struct devic
                err = add_mtd_partitions(info->mtd, info->partitions, err);
                if (err) 
                        printk(KERN_ERR PFX "cannot add/parse partitions\n");
+       } else {
+               err = add_mtd_device(info->mtd);
        }
 
        if (err == 0)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to