diff options
author | Ben Dooks <ben-linux@fluff.org> | 2009-12-23 15:34:29 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-12-23 15:34:29 -0500 |
commit | 2b542a13a94f310e718f2ed57b0f712b9ddbbbef (patch) | |
tree | 3705df4d0494150be7c7e7d3813049e5dc906dbb /arch/arm/plat-s3c | |
parent | ce8877b542d946ee4fb29b57dc9d6549648b1558 (diff) |
ARM: S3C: Fix NAND device registration by s3c_nand_set_platdata().
Fix two bugs in s3c_nand_set_platdata() where thet device's platform
data was not set, and the wrong error check was being performed on
the return of s3c_nand_copy_set().
Fixes the following OOPS:
Unable to handle kernel NULL pointer dereference at virtual address 00000004
PC is at s3c24xx_nand_probe+0x234/0x594
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c')
-rw-r--r-- | arch/arm/plat-s3c/dev-nand.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/plat-s3c/dev-nand.c b/arch/arm/plat-s3c/dev-nand.c index e771e77dcd54..84808ccda70e 100644 --- a/arch/arm/plat-s3c/dev-nand.c +++ b/arch/arm/plat-s3c/dev-nand.c | |||
@@ -114,7 +114,7 @@ void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand) | |||
114 | 114 | ||
115 | for (i = 0; i < npd->nr_sets; i++) { | 115 | for (i = 0; i < npd->nr_sets; i++) { |
116 | ret = s3c_nand_copy_set(to); | 116 | ret = s3c_nand_copy_set(to); |
117 | if (!ret) { | 117 | if (ret) { |
118 | printk(KERN_ERR "%s: failed to copy set %d\n", | 118 | printk(KERN_ERR "%s: failed to copy set %d\n", |
119 | __func__, i); | 119 | __func__, i); |
120 | return; | 120 | return; |
@@ -122,6 +122,8 @@ void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand) | |||
122 | to++; | 122 | to++; |
123 | } | 123 | } |
124 | } | 124 | } |
125 | |||
126 | s3c_device_nand.dev.platform_data = npd; | ||
125 | } | 127 | } |
126 | 128 | ||
127 | EXPORT_SYMBOL_GPL(s3c_nand_set_platdata); | 129 | EXPORT_SYMBOL_GPL(s3c_nand_set_platdata); |