Commit 6a567c41 authored by Banajit Goswami's avatar Banajit Goswami Committed by Kukjin Kim

ARM: S3C24XX: Use generic s3c_set_platdata for devices

Signed-off-by: default avatarBanajit Goswami <banajit.g@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 7569fc54
...@@ -150,9 +150,8 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) ...@@ -150,9 +150,8 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
{ {
struct s3c2410fb_mach_info *npd; struct s3c2410fb_mach_info *npd;
npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL); npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd);
if (npd) { if (npd) {
s3c_device_lcd.dev.platform_data = npd;
npd->displays = kmemdup(pd->displays, npd->displays = kmemdup(pd->displays,
sizeof(struct s3c2410fb_display) * npd->num_displays, sizeof(struct s3c2410fb_display) * npd->num_displays,
GFP_KERNEL); GFP_KERNEL);
...@@ -188,12 +187,10 @@ struct platform_device s3c_device_ts = { ...@@ -188,12 +187,10 @@ struct platform_device s3c_device_ts = {
}; };
EXPORT_SYMBOL(s3c_device_ts); EXPORT_SYMBOL(s3c_device_ts);
static struct s3c2410_ts_mach_info s3c2410ts_info;
void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info) void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
{ {
memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info)); s3c_set_platdata(hard_s3c2410ts_info,
s3c_device_ts.dev.platform_data = &s3c2410ts_info; sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts);
} }
/* USB Device (Gadget)*/ /* USB Device (Gadget)*/
...@@ -223,15 +220,7 @@ EXPORT_SYMBOL(s3c_device_usbgadget); ...@@ -223,15 +220,7 @@ EXPORT_SYMBOL(s3c_device_usbgadget);
void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
{ {
struct s3c2410_udc_mach_info *npd; s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget);
npd = kmalloc(sizeof(*npd), GFP_KERNEL);
if (npd) {
memcpy(npd, pd, sizeof(*npd));
s3c_device_usbgadget.dev.platform_data = npd;
} else {
printk(KERN_ERR "no memory for udc platform data\n");
}
} }
/* USB High Speed 2.0 Device (Gadget) */ /* USB High Speed 2.0 Device (Gadget) */
...@@ -263,15 +252,7 @@ struct platform_device s3c_device_usb_hsudc = { ...@@ -263,15 +252,7 @@ struct platform_device s3c_device_usb_hsudc = {
void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd) void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd)
{ {
struct s3c24xx_hsudc_platdata *npd; s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc);
npd = kmalloc(sizeof(*npd), GFP_KERNEL);
if (npd) {
memcpy(npd, pd, sizeof(*npd));
s3c_device_usb_hsudc.dev.platform_data = npd;
} else {
printk(KERN_ERR "no memory for udc platform data\n");
}
} }
/* IIS */ /* IIS */
...@@ -383,13 +364,8 @@ EXPORT_SYMBOL(s3c_device_sdi); ...@@ -383,13 +364,8 @@ EXPORT_SYMBOL(s3c_device_sdi);
void __init 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; s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata),
&s3c_device_sdi);
npd = kmemdup(pdata, sizeof(struct s3c24xx_mci_pdata), GFP_KERNEL);
if (!npd)
printk(KERN_ERR "%s: no memory to copy pdata", __func__);
s3c_device_sdi.dev.platform_data = npd;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment