diff options
Diffstat (limited to 'arch/arm/plat-s3c24xx/devs.c')
-rw-r--r-- | arch/arm/plat-s3c24xx/devs.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c index 73667994518a..a76bf2df3333 100644 --- a/arch/arm/plat-s3c24xx/devs.c +++ b/arch/arm/plat-s3c24xx/devs.c | |||
@@ -150,9 +150,8 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) | |||
150 | { | 150 | { |
151 | struct s3c2410fb_mach_info *npd; | 151 | struct s3c2410fb_mach_info *npd; |
152 | 152 | ||
153 | npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL); | 153 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd); |
154 | if (npd) { | 154 | if (npd) { |
155 | s3c_device_lcd.dev.platform_data = npd; | ||
156 | npd->displays = kmemdup(pd->displays, | 155 | npd->displays = kmemdup(pd->displays, |
157 | sizeof(struct s3c2410fb_display) * npd->num_displays, | 156 | sizeof(struct s3c2410fb_display) * npd->num_displays, |
158 | GFP_KERNEL); | 157 | GFP_KERNEL); |
@@ -188,12 +187,10 @@ struct platform_device s3c_device_ts = { | |||
188 | }; | 187 | }; |
189 | EXPORT_SYMBOL(s3c_device_ts); | 188 | EXPORT_SYMBOL(s3c_device_ts); |
190 | 189 | ||
191 | static struct s3c2410_ts_mach_info s3c2410ts_info; | ||
192 | |||
193 | void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info) | 190 | void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info) |
194 | { | 191 | { |
195 | memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info)); | 192 | s3c_set_platdata(hard_s3c2410ts_info, |
196 | s3c_device_ts.dev.platform_data = &s3c2410ts_info; | 193 | sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts); |
197 | } | 194 | } |
198 | 195 | ||
199 | /* USB Device (Gadget)*/ | 196 | /* USB Device (Gadget)*/ |
@@ -223,15 +220,7 @@ EXPORT_SYMBOL(s3c_device_usbgadget); | |||
223 | 220 | ||
224 | void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) | 221 | void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) |
225 | { | 222 | { |
226 | struct s3c2410_udc_mach_info *npd; | 223 | s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget); |
227 | |||
228 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); | ||
229 | if (npd) { | ||
230 | memcpy(npd, pd, sizeof(*npd)); | ||
231 | s3c_device_usbgadget.dev.platform_data = npd; | ||
232 | } else { | ||
233 | printk(KERN_ERR "no memory for udc platform data\n"); | ||
234 | } | ||
235 | } | 224 | } |
236 | 225 | ||
237 | /* USB High Speed 2.0 Device (Gadget) */ | 226 | /* USB High Speed 2.0 Device (Gadget) */ |
@@ -263,15 +252,7 @@ struct platform_device s3c_device_usb_hsudc = { | |||
263 | 252 | ||
264 | void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd) | 253 | void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd) |
265 | { | 254 | { |
266 | struct s3c24xx_hsudc_platdata *npd; | 255 | s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc); |
267 | |||
268 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); | ||
269 | if (npd) { | ||
270 | memcpy(npd, pd, sizeof(*npd)); | ||
271 | s3c_device_usb_hsudc.dev.platform_data = npd; | ||
272 | } else { | ||
273 | printk(KERN_ERR "no memory for udc platform data\n"); | ||
274 | } | ||
275 | } | 256 | } |
276 | 257 | ||
277 | /* IIS */ | 258 | /* IIS */ |
@@ -383,13 +364,8 @@ EXPORT_SYMBOL(s3c_device_sdi); | |||
383 | 364 | ||
384 | void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata) | 365 | void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata) |
385 | { | 366 | { |
386 | struct s3c24xx_mci_pdata *npd; | 367 | s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata), |
387 | 368 | &s3c_device_sdi); | |
388 | npd = kmemdup(pdata, sizeof(struct s3c24xx_mci_pdata), GFP_KERNEL); | ||
389 | if (!npd) | ||
390 | printk(KERN_ERR "%s: no memory to copy pdata", __func__); | ||
391 | |||
392 | s3c_device_sdi.dev.platform_data = npd; | ||
393 | } | 369 | } |
394 | 370 | ||
395 | 371 | ||