diff options
author | Arnaud Patard | 2010-04-22 10:47:44 +0200 |
---|---|---|
committer | Ben Dooks | 2010-05-06 00:07:13 +0900 |
commit | f44c67cdc3182dd59cae299488687c6280027410 (patch) | |
tree | 5f287ef268fa94f982ab0169142853ade3eeb48e | |
parent | 17dcd13a3793d434c030dcf9c52ad0d43493b2a0 (diff) |
ARM: S3C24XX: fix s3c2410fb platdata passing
Setting s3c2410fb_mach_info displays field with a struct marked as __initdata
means it won't be available later for ioctls like FBIOPUT_VSCREENINFO and they
will fail. Copying in s3c24xx_fb_set_platdata() is fixing this issue.
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r-- | arch/arm/plat-s3c24xx/devs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c index 9265f09bfa58..429e45321384 100644 --- a/arch/arm/plat-s3c24xx/devs.c +++ b/arch/arm/plat-s3c24xx/devs.c @@ -21,6 +21,7 @@ #include <linux/platform_device.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/string.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> @@ -149,10 +150,14 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) { struct s3c2410fb_mach_info *npd; - npd = kmalloc(sizeof(*npd), GFP_KERNEL); + npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL); if (npd) { - memcpy(npd, pd, sizeof(*npd)); s3c_device_lcd.dev.platform_data = npd; + npd->displays = kmemdup(pd->displays, + sizeof(struct s3c2410fb_display) * npd->num_displays, + GFP_KERNEL); + if (!npd->displays) + printk(KERN_ERR "no memory for LCD display data\n"); } else { printk(KERN_ERR "no memory for LCD platform data\n"); } |