ARM: SAMSUNG: Move mach/ts.h to plat/ts.h
[pandora-kernel.git] / arch / arm / plat-s3c24xx / devs.c
index 8c6de1c..5858373 100644 (file)
@@ -20,6 +20,8 @@
 #include <linux/serial_core.h>
 #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>
@@ -37,8 +39,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/regs-spi.h>
-
-#include <mach/ts.h>
+#include <plat/ts.h>
 
 /* Serial port registrations */
 
@@ -148,10 +149,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");
        }
@@ -337,14 +342,6 @@ struct platform_device s3c_device_adc = {
        .resource         = s3c_adc_resource,
 };
 
-/* HWMON */
-
-struct platform_device s3c_device_hwmon = {
-       .name           = "s3c-hwmon",
-       .id             = -1,
-       .dev.parent     = &s3c_device_adc.dev,
-};
-
 /* SDI */
 
 static struct resource s3c_sdi_resource[] = {
@@ -370,7 +367,7 @@ struct platform_device s3c_device_sdi = {
 
 EXPORT_SYMBOL(s3c_device_sdi);
 
-void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
+void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
 {
        struct s3c24xx_mci_pdata *npd;