diff options
Diffstat (limited to 'arch/arm/plat-s3c/dev-nand.c')
| -rw-r--r-- | arch/arm/plat-s3c/dev-nand.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/plat-s3c/dev-nand.c b/arch/arm/plat-s3c/dev-nand.c index e771e77dcd54..a52fb6cf618f 100644 --- a/arch/arm/plat-s3c/dev-nand.c +++ b/arch/arm/plat-s3c/dev-nand.c | |||
| @@ -58,8 +58,8 @@ static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set) | |||
| 58 | return -ENOMEM; | 58 | return -ENOMEM; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | size = sizeof(int) * set->nr_chips; | 61 | if (set->nr_map && set->nr_chips) { |
| 62 | if (size) { | 62 | size = sizeof(int) * set->nr_chips; |
| 63 | ptr = kmemdup(set->nr_map, size, GFP_KERNEL); | 63 | ptr = kmemdup(set->nr_map, size, GFP_KERNEL); |
| 64 | set->nr_map = ptr; | 64 | set->nr_map = ptr; |
| 65 | 65 | ||
| @@ -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); |
