diff options
Diffstat (limited to 'arch/arm/plat-s3c24xx/devs.c')
-rw-r--r-- | arch/arm/plat-s3c24xx/devs.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c index 3166f320fd65..cd5b41d0b5a4 100644 --- a/arch/arm/plat-s3c24xx/devs.c +++ b/arch/arm/plat-s3c24xx/devs.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/string.h> | ||
24 | 25 | ||
25 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
26 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
@@ -149,10 +150,14 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) | |||
149 | { | 150 | { |
150 | struct s3c2410fb_mach_info *npd; | 151 | struct s3c2410fb_mach_info *npd; |
151 | 152 | ||
152 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); | 153 | npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL); |
153 | if (npd) { | 154 | if (npd) { |
154 | memcpy(npd, pd, sizeof(*npd)); | ||
155 | s3c_device_lcd.dev.platform_data = npd; | 155 | s3c_device_lcd.dev.platform_data = npd; |
156 | npd->displays = kmemdup(pd->displays, | ||
157 | sizeof(struct s3c2410fb_display) * npd->num_displays, | ||
158 | GFP_KERNEL); | ||
159 | if (!npd->displays) | ||
160 | printk(KERN_ERR "no memory for LCD display data\n"); | ||
156 | } else { | 161 | } else { |
157 | printk(KERN_ERR "no memory for LCD platform data\n"); | 162 | printk(KERN_ERR "no memory for LCD platform data\n"); |
158 | } | 163 | } |
@@ -363,7 +368,7 @@ struct platform_device s3c_device_sdi = { | |||
363 | 368 | ||
364 | EXPORT_SYMBOL(s3c_device_sdi); | 369 | EXPORT_SYMBOL(s3c_device_sdi); |
365 | 370 | ||
366 | void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata) | 371 | void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata) |
367 | { | 372 | { |
368 | struct s3c24xx_mci_pdata *npd; | 373 | struct s3c24xx_mci_pdata *npd; |
369 | 374 | ||