diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-08-10 18:17:52 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-08-10 18:17:52 -0400 |
commit | 0b019a41553a919965bb02d07d54e3e6c57a796d (patch) | |
tree | 6e329b4159b440d2aac5200a5c07103fe261c096 /arch/arm/plat-samsung/platformdata.c | |
parent | 5f6878b0d22f9b93f9698f88c335007e2a3c3bbc (diff) | |
parent | 054d5c9238f3c577ad51195c3ee7803613f322cc (diff) |
Merge branches 'master' and 'devel' into for-linus
Conflicts:
arch/arm/Kconfig
arch/arm/mm/Kconfig
Diffstat (limited to 'arch/arm/plat-samsung/platformdata.c')
-rw-r--r-- | arch/arm/plat-samsung/platformdata.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/platformdata.c b/arch/arm/plat-samsung/platformdata.c new file mode 100644 index 000000000000..7cf2e1e3b20f --- /dev/null +++ b/arch/arm/plat-samsung/platformdata.c | |||
@@ -0,0 +1,37 @@ | |||
1 | /* linux/arch/arm/plat-samsung/platformdata.c | ||
2 | * | ||
3 | * Copyright 2010 Ben Dooks <ben-linux <at> fluff.org> | ||
4 | * | ||
5 | * Helper for platform data setting | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/string.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | |||
16 | #include <plat/devs.h> | ||
17 | |||
18 | void __init *s3c_set_platdata(void *pd, size_t pdsize, | ||
19 | struct platform_device *pdev) | ||
20 | { | ||
21 | void *npd; | ||
22 | |||
23 | if (!pd) { | ||
24 | /* too early to use dev_name(), may not be registered */ | ||
25 | printk(KERN_ERR "%s: no platform data supplied\n", pdev->name); | ||
26 | return NULL; | ||
27 | } | ||
28 | |||
29 | npd = kmemdup(pd, pdsize, GFP_KERNEL); | ||
30 | if (!npd) { | ||
31 | printk(KERN_ERR "%s: cannot clone platform data\n", pdev->name); | ||
32 | return NULL; | ||
33 | } | ||
34 | |||
35 | pdev->dev.platform_data = npd; | ||
36 | return npd; | ||
37 | } | ||