summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorFrank Li <Frank.Li@freescale.com>2010-09-06 13:19:49 +0800
committerJustin Waters <justin.waters@timesys.com>2010-12-13 16:09:27 -0500
commit411eea2abcaae3bb80612f987bb1b8a36b5dd685 (patch)
treecd7f0a02411c02f9f14f78b54409386bae5e8249 /drivers/mtd/nand
parentafe8502b59a2fb8609c599cfbe4f7ad95cf079e2 (diff)
ENGR00127171-5 Kernel Upgrade: Fix all drivers build error for mx23/mx28
Fix build error because kernel upgrade Signed-off-by: Frank Li <Frank.Li@freescale.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/gpmi-nfc/gpmi-nfc-main.c1
-rw-r--r--drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c22
2 files changed, 10 insertions, 13 deletions
diff --git a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-main.c b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-main.c
index 1400deb58e52..19982b1b5b95 100644
--- a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-main.c
+++ b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-main.c
@@ -21,6 +21,7 @@
#include <linux/slab.h>
#include "gpmi-nfc.h"
+#include "linux/slab.h"
/*
* This structure contains the "safe" GPMI timing that should succeed with any
diff --git a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
index cb5dc4d50e87..5a2325aa30a2 100644
--- a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
+++ b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
@@ -21,6 +21,7 @@
#include <linux/slab.h>
#include "gpmi-nfc.h"
+#include "linux/slab.h"
/*
* Indicates the driver should register the MTD that represents the entire
@@ -1887,16 +1888,13 @@ static int mil_boot_areas_init(struct gpmi_nfc_data *this)
/* Find the general use MTD. */
- for (i = 0; i < MAX_MTD_DEVICES; i++) {
-
- /* Get the current MTD so we can examine it. */
-
- search_mtd = get_mtd_device(0, i);
+ i = 0;
+ while (search_mtd = get_mtd_device(0, i)) {
/* Check if we got nonsense. */
if ((!search_mtd) || (search_mtd == ERR_PTR(-ENODEV)))
- continue;
+ break;
/* Check if the current MTD is one of our remainders. */
@@ -1907,6 +1905,7 @@ static int mil_boot_areas_init(struct gpmi_nfc_data *this)
put_mtd_device(search_mtd);
+ i++;
}
if (!mil->general_use_mtd) {
@@ -1985,17 +1984,13 @@ static int mil_boot_areas_init(struct gpmi_nfc_data *this)
add_mtd_partitions(mtd, partitions, 4);
/* Find the remainder partitions. */
-
- for (i = 0; i < MAX_MTD_DEVICES; i++) {
-
- /* Get the current MTD so we can examine it. */
-
- search_mtd = get_mtd_device(0, i);
+ i = 0;
+ while (search_mtd = get_mtd_device(0, i)) {
/* Check if we got nonsense. */
if ((!search_mtd) || (search_mtd == ERR_PTR(-ENODEV)))
- continue;
+ break;
/* Check if the current MTD is one of our remainders. */
@@ -2009,6 +2004,7 @@ static int mil_boot_areas_init(struct gpmi_nfc_data *this)
put_mtd_device(search_mtd);
+ i++;
}
if (!chip_0_remainder_mtd || !medium_remainder_mtd) {