Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f44c67cd authored by Arnaud Patard's avatar Arnaud Patard Committed by Ben Dooks
Browse files

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: default avatarArnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 17dcd13a
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/string.h>


#include <asm/mach/arch.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.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;
	struct s3c2410fb_mach_info *npd;


	npd = kmalloc(sizeof(*npd), GFP_KERNEL);
	npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
	if (npd) {
	if (npd) {
		memcpy(npd, pd, sizeof(*npd));
		s3c_device_lcd.dev.platform_data = 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 {
	} else {
		printk(KERN_ERR "no memory for LCD platform data\n");
		printk(KERN_ERR "no memory for LCD platform data\n");
	}
	}