patch-2.4.21 linux-2.4.21/drivers/mtd/maps/dc21285.c
Next file: linux-2.4.21/drivers/mtd/maps/edb7312.c
Previous file: linux-2.4.21/drivers/mtd/maps/ceiva.c
Back to the patch index
Back to the overall index
- Lines: 50
- Date:
2003-06-13 07:51:34.000000000 -0700
- Orig file:
linux-2.4.20/drivers/mtd/maps/dc21285.c
- Orig date:
2002-08-02 17:39:44.000000000 -0700
diff -urN linux-2.4.20/drivers/mtd/maps/dc21285.c linux-2.4.21/drivers/mtd/maps/dc21285.c
@@ -5,9 +5,9 @@
*
* This code is GPL
*
- * $Id: dc21285.c,v 1.7 2001/10/11 16:17:51 nico Exp $
+ * $Id: dc21285.c,v 1.9 2002/10/14 12:22:10 rmk Exp $
*/
-
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -131,7 +131,7 @@
dc21285_map.buswidth*8);
/* Let's map the flash area */
- dc21285_map.map_priv_1 = (unsigned long)__ioremap(DC21285_FLASH, 16*1024*1024, 0);
+ dc21285_map.map_priv_1 = (unsigned long)ioremap(DC21285_FLASH, 16*1024*1024);
if (!dc21285_map.map_priv_1) {
printk("Failed to ioremap\n");
return -EIO;
@@ -139,21 +139,22 @@
mymtd = do_map_probe("cfi_probe", &dc21285_map);
if (mymtd) {
- int nrparts;
+ int nrparts = 0;
mymtd->module = THIS_MODULE;
/* partition fixup */
+#ifdef CONFIG_MTD_REDBOOT_PARTS
nrparts = parse_redboot_partitions(mymtd, &dc21285_parts);
- if (nrparts <=0) {
+#endif
+ if (nrparts > 0) {
+ add_mtd_partitions(mymtd, dc21285_parts, nrparts);
+ } else if (nrparts == 0) {
printk(KERN_NOTICE "RedBoot partition table failed\n");
- iounmap((void *)dc21285_map.map_priv_1);
- return -ENXIO;
+ add_mtd_device(mymtd);
}
- add_mtd_partitions(mymtd, dc21285_parts, nrparts);
-
/*
* Flash timing is determined with bits 19-16 of the
* CSR_SA110_CNTL. The value is the number of wait cycles, or
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)