diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-10-19 16:47:20 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2017-10-19 16:47:20 -0400 |
commit | 818f62ab28494c495d62d136fba7a4c1024c8a03 (patch) | |
tree | cd9818e4b4b9e017ae339519613ca35eaf0958d6 | |
parent | 977478f9e0843a4abd8d59484ab4ca0c2a70ce1d (diff) | |
parent | 9e43eca3c87476f75680f472ff3ebcd85f357b86 (diff) |
Merge tag 'samsung-soc-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/soc
Pull "Samsung mach/soc changes for v4.15" from Krzysztof Kozłowski:
1. Cleanups for s3c24xx and s3c64xx (memory allocation printks, code
style).
2. Remove of Exynos4212 related dead code (no more support for this
SoC).
* tag 'samsung-soc-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
ARM: EXYNOS: Remove Exynos4212 related dead code
ARM: SAMSUNG: Simplify size used for kzalloc
ARM: SAMSUNG: Remove printk for failed memory allocation
ARM: s3c64xx: Delete an unnecessary return statement in samsung_bl_set
ARM: s3c64xx: Remove printk for failed memory allocation in samsung_bl_set
ARM: s3c2410: Fix typos in a comments
ARM: s3c24xx: Simplify size used for kzalloc in iotiming get
ARM: s3c24xx: Remove printk for failed memory allocation in iotiming get
-rw-r--r-- | arch/arm/mach-exynos/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-exynos/common.h | 11 | ||||
-rw-r--r-- | arch/arm/mach-exynos/exynos.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/firmware.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-exynos/pm.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-exynos/suspend.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/iotiming-s3c2410.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/iotiming-s3c2412.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/dev-backlight.c | 10 | ||||
-rw-r--r-- | arch/arm/plat-samsung/adc.c | 12 | ||||
-rw-r--r-- | arch/arm/plat-samsung/devs.c | 33 | ||||
-rw-r--r-- | arch/arm/plat-samsung/platformdata.c | 4 |
12 files changed, 27 insertions, 78 deletions
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 0a99140b6ba2..44fa753bd79c 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig | |||
@@ -85,11 +85,6 @@ config CPU_EXYNOS4210 | |||
85 | default y | 85 | default y |
86 | depends on ARCH_EXYNOS4 | 86 | depends on ARCH_EXYNOS4 |
87 | 87 | ||
88 | config SOC_EXYNOS4212 | ||
89 | bool "SAMSUNG EXYNOS4212" | ||
90 | default y | ||
91 | depends on ARCH_EXYNOS4 | ||
92 | |||
93 | config SOC_EXYNOS4412 | 88 | config SOC_EXYNOS4412 |
94 | bool "SAMSUNG EXYNOS4412" | 89 | bool "SAMSUNG EXYNOS4412" |
95 | default y | 90 | default y |
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 9424a8a9f308..3f715524c9d6 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #define EXYNOS3_SOC_MASK 0xFFFFF000 | 18 | #define EXYNOS3_SOC_MASK 0xFFFFF000 |
19 | 19 | ||
20 | #define EXYNOS4210_CPU_ID 0x43210000 | 20 | #define EXYNOS4210_CPU_ID 0x43210000 |
21 | #define EXYNOS4212_CPU_ID 0x43220000 | ||
22 | #define EXYNOS4412_CPU_ID 0xE4412200 | 21 | #define EXYNOS4412_CPU_ID 0xE4412200 |
23 | #define EXYNOS4_CPU_MASK 0xFFFE0000 | 22 | #define EXYNOS4_CPU_MASK 0xFFFE0000 |
24 | 23 | ||
@@ -39,7 +38,6 @@ static inline int is_samsung_##name(void) \ | |||
39 | 38 | ||
40 | IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK) | 39 | IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK) |
41 | IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) | 40 | IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) |
42 | IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) | ||
43 | IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) | 41 | IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) |
44 | IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) | 42 | IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) |
45 | IS_SAMSUNG_CPU(exynos5410, EXYNOS5410_SOC_ID, EXYNOS5_SOC_MASK) | 43 | IS_SAMSUNG_CPU(exynos5410, EXYNOS5410_SOC_ID, EXYNOS5_SOC_MASK) |
@@ -59,12 +57,6 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK) | |||
59 | # define soc_is_exynos4210() 0 | 57 | # define soc_is_exynos4210() 0 |
60 | #endif | 58 | #endif |
61 | 59 | ||
62 | #if defined(CONFIG_SOC_EXYNOS4212) | ||
63 | # define soc_is_exynos4212() is_samsung_exynos4212() | ||
64 | #else | ||
65 | # define soc_is_exynos4212() 0 | ||
66 | #endif | ||
67 | |||
68 | #if defined(CONFIG_SOC_EXYNOS4412) | 60 | #if defined(CONFIG_SOC_EXYNOS4412) |
69 | # define soc_is_exynos4412() is_samsung_exynos4412() | 61 | # define soc_is_exynos4412() is_samsung_exynos4412() |
70 | #else | 62 | #else |
@@ -105,8 +97,7 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK) | |||
105 | # define soc_is_exynos5800() 0 | 97 | # define soc_is_exynos5800() 0 |
106 | #endif | 98 | #endif |
107 | 99 | ||
108 | #define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \ | 100 | #define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4412()) |
109 | soc_is_exynos4412()) | ||
110 | #define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \ | 101 | #define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \ |
111 | soc_is_exynos5420() || soc_is_exynos5800()) | 102 | soc_is_exynos5420() || soc_is_exynos5800()) |
112 | 103 | ||
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index c404c15ad07f..9a9caac1125a 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c | |||
@@ -195,7 +195,6 @@ static void __init exynos_dt_machine_init(void) | |||
195 | exynos_cpuidle.dev.platform_data = &cpuidle_coupled_exynos_data; | 195 | exynos_cpuidle.dev.platform_data = &cpuidle_coupled_exynos_data; |
196 | #endif | 196 | #endif |
197 | if (of_machine_is_compatible("samsung,exynos4210") || | 197 | if (of_machine_is_compatible("samsung,exynos4210") || |
198 | of_machine_is_compatible("samsung,exynos4212") || | ||
199 | (of_machine_is_compatible("samsung,exynos4412") && | 198 | (of_machine_is_compatible("samsung,exynos4412") && |
200 | of_machine_is_compatible("samsung,trats2")) || | 199 | of_machine_is_compatible("samsung,trats2")) || |
201 | of_machine_is_compatible("samsung,exynos3250") || | 200 | of_machine_is_compatible("samsung,exynos3250") || |
@@ -208,7 +207,6 @@ static char const *const exynos_dt_compat[] __initconst = { | |||
208 | "samsung,exynos3250", | 207 | "samsung,exynos3250", |
209 | "samsung,exynos4", | 208 | "samsung,exynos4", |
210 | "samsung,exynos4210", | 209 | "samsung,exynos4210", |
211 | "samsung,exynos4212", | ||
212 | "samsung,exynos4412", | 210 | "samsung,exynos4412", |
213 | "samsung,exynos5", | 211 | "samsung,exynos5", |
214 | "samsung,exynos5250", | 212 | "samsung,exynos5250", |
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index e81a78b125d9..2a51e4603a6f 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c | |||
@@ -70,12 +70,7 @@ static int exynos_cpu_boot(int cpu) | |||
70 | 70 | ||
71 | /* | 71 | /* |
72 | * The second parameter of SMC_CMD_CPU1BOOT command means CPU id. | 72 | * The second parameter of SMC_CMD_CPU1BOOT command means CPU id. |
73 | * But, Exynos4212 has only one secondary CPU so second parameter | ||
74 | * isn't used for informing secure firmware about CPU id. | ||
75 | */ | 73 | */ |
76 | if (soc_is_exynos4212()) | ||
77 | cpu = 0; | ||
78 | |||
79 | exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0); | 74 | exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0); |
80 | return 0; | 75 | return 0; |
81 | } | 76 | } |
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 1a7e5b5d08d8..c9740d96db9e 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c | |||
@@ -167,8 +167,7 @@ void exynos_enter_aftr(void) | |||
167 | 167 | ||
168 | exynos_pm_central_suspend(); | 168 | exynos_pm_central_suspend(); |
169 | 169 | ||
170 | if (of_machine_is_compatible("samsung,exynos4212") || | 170 | if (of_machine_is_compatible("samsung,exynos4412")) { |
171 | of_machine_is_compatible("samsung,exynos4412")) { | ||
172 | /* Setting SEQ_OPTION register */ | 171 | /* Setting SEQ_OPTION register */ |
173 | pmu_raw_writel(S5P_USE_STANDBY_WFI0 | S5P_USE_STANDBY_WFE0, | 172 | pmu_raw_writel(S5P_USE_STANDBY_WFI0 | S5P_USE_STANDBY_WFE0, |
174 | S5P_CENTRAL_SEQ_OPTION); | 173 | S5P_CENTRAL_SEQ_OPTION); |
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index b529ba04ed16..370d37ded7e7 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c | |||
@@ -225,7 +225,6 @@ static int __init exynos_pmu_irq_init(struct device_node *node, | |||
225 | 225 | ||
226 | EXYNOS_PMU_IRQ(exynos3250_pmu_irq, "samsung,exynos3250-pmu"); | 226 | EXYNOS_PMU_IRQ(exynos3250_pmu_irq, "samsung,exynos3250-pmu"); |
227 | EXYNOS_PMU_IRQ(exynos4210_pmu_irq, "samsung,exynos4210-pmu"); | 227 | EXYNOS_PMU_IRQ(exynos4210_pmu_irq, "samsung,exynos4210-pmu"); |
228 | EXYNOS_PMU_IRQ(exynos4212_pmu_irq, "samsung,exynos4212-pmu"); | ||
229 | EXYNOS_PMU_IRQ(exynos4412_pmu_irq, "samsung,exynos4412-pmu"); | 228 | EXYNOS_PMU_IRQ(exynos4412_pmu_irq, "samsung,exynos4412-pmu"); |
230 | EXYNOS_PMU_IRQ(exynos5250_pmu_irq, "samsung,exynos5250-pmu"); | 229 | EXYNOS_PMU_IRQ(exynos5250_pmu_irq, "samsung,exynos5250-pmu"); |
231 | EXYNOS_PMU_IRQ(exynos5420_pmu_irq, "samsung,exynos5420-pmu"); | 230 | EXYNOS_PMU_IRQ(exynos5420_pmu_irq, "samsung,exynos5420-pmu"); |
@@ -617,9 +616,6 @@ static const struct of_device_id exynos_pmu_of_device_ids[] __initconst = { | |||
617 | .compatible = "samsung,exynos4210-pmu", | 616 | .compatible = "samsung,exynos4210-pmu", |
618 | .data = &exynos4_pm_data, | 617 | .data = &exynos4_pm_data, |
619 | }, { | 618 | }, { |
620 | .compatible = "samsung,exynos4212-pmu", | ||
621 | .data = &exynos4_pm_data, | ||
622 | }, { | ||
623 | .compatible = "samsung,exynos4412-pmu", | 619 | .compatible = "samsung,exynos4412-pmu", |
624 | .data = &exynos4_pm_data, | 620 | .data = &exynos4_pm_data, |
625 | }, { | 621 | }, { |
diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c index b7970f1fa3d5..d5f1f06e4811 100644 --- a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c | |||
@@ -206,7 +206,7 @@ static int calc_tacc(unsigned int cyc, int nwait_en, | |||
206 | } | 206 | } |
207 | 207 | ||
208 | /** | 208 | /** |
209 | * s3c2410_calc_bank - calculate bank timing infromation | 209 | * s3c2410_calc_bank - calculate bank timing information |
210 | * @cfg: The configuration we need to calculate for. | 210 | * @cfg: The configuration we need to calculate for. |
211 | * @bt: The bank timing information. | 211 | * @bt: The bank timing information. |
212 | * | 212 | * |
@@ -453,11 +453,9 @@ int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg, | |||
453 | s3c_freq_iodbg("%s: bank %d: con %08lx\n", | 453 | s3c_freq_iodbg("%s: bank %d: con %08lx\n", |
454 | __func__, bank, bankcon); | 454 | __func__, bank, bankcon); |
455 | 455 | ||
456 | bt = kzalloc(sizeof(struct s3c2410_iobank_timing), GFP_KERNEL); | 456 | bt = kzalloc(sizeof(*bt), GFP_KERNEL); |
457 | if (!bt) { | 457 | if (!bt) |
458 | printk(KERN_ERR "%s: no memory for bank\n", __func__); | ||
459 | return -ENOMEM; | 458 | return -ENOMEM; |
460 | } | ||
461 | 459 | ||
462 | /* find out in nWait is enabled for bank. */ | 460 | /* find out in nWait is enabled for bank. */ |
463 | 461 | ||
diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c index 28b13951de87..c5b12f6b02b5 100644 --- a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #define print_ns(x) ((x) / 10), ((x) % 10) | 35 | #define print_ns(x) ((x) / 10), ((x) % 10) |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * s3c2412_print_timing - print timing infromation via printk. | 38 | * s3c2412_print_timing - print timing information via printk. |
39 | * @pfx: The prefix to print each line with. | 39 | * @pfx: The prefix to print each line with. |
40 | * @iot: The IO timing information | 40 | * @iot: The IO timing information |
41 | */ | 41 | */ |
@@ -242,11 +242,9 @@ int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, | |||
242 | if (!bank_is_io(bank, bankcfg)) | 242 | if (!bank_is_io(bank, bankcfg)) |
243 | continue; | 243 | continue; |
244 | 244 | ||
245 | bt = kzalloc(sizeof(struct s3c2412_iobank_timing), GFP_KERNEL); | 245 | bt = kzalloc(sizeof(*bt), GFP_KERNEL); |
246 | if (!bt) { | 246 | if (!bt) |
247 | printk(KERN_ERR "%s: no memory for bank\n", __func__); | ||
248 | return -ENOMEM; | 247 | return -ENOMEM; |
249 | } | ||
250 | 248 | ||
251 | timings->bank[bank].io_2412 = bt; | 249 | timings->bank[bank].io_2412 = bt; |
252 | s3c2412_iotiming_getbank(cfg, bt, bank); | 250 | s3c2412_iotiming_getbank(cfg, bt, bank); |
diff --git a/arch/arm/mach-s3c64xx/dev-backlight.c b/arch/arm/mach-s3c64xx/dev-backlight.c index e62e789f9aee..7ef8b9019344 100644 --- a/arch/arm/mach-s3c64xx/dev-backlight.c +++ b/arch/arm/mach-s3c64xx/dev-backlight.c | |||
@@ -94,17 +94,14 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, | |||
94 | 94 | ||
95 | samsung_bl_device = kmemdup(&samsung_dfl_bl_device, | 95 | samsung_bl_device = kmemdup(&samsung_dfl_bl_device, |
96 | sizeof(struct platform_device), GFP_KERNEL); | 96 | sizeof(struct platform_device), GFP_KERNEL); |
97 | if (!samsung_bl_device) { | 97 | if (!samsung_bl_device) |
98 | printk(KERN_ERR "%s: no memory for platform dev\n", __func__); | ||
99 | return; | 98 | return; |
100 | } | ||
101 | 99 | ||
102 | samsung_bl_drvdata = kmemdup(&samsung_dfl_bl_data, | 100 | samsung_bl_drvdata = kmemdup(&samsung_dfl_bl_data, |
103 | sizeof(samsung_dfl_bl_data), GFP_KERNEL); | 101 | sizeof(samsung_dfl_bl_data), GFP_KERNEL); |
104 | if (!samsung_bl_drvdata) { | 102 | if (!samsung_bl_drvdata) |
105 | printk(KERN_ERR "%s: no memory for platform dev\n", __func__); | ||
106 | goto err_data; | 103 | goto err_data; |
107 | } | 104 | |
108 | samsung_bl_device->dev.platform_data = &samsung_bl_drvdata->plat_data; | 105 | samsung_bl_device->dev.platform_data = &samsung_bl_drvdata->plat_data; |
109 | samsung_bl_drvdata->gpio_info = gpio_info; | 106 | samsung_bl_drvdata->gpio_info = gpio_info; |
110 | samsung_bl_data = &samsung_bl_drvdata->plat_data; | 107 | samsung_bl_data = &samsung_bl_drvdata->plat_data; |
@@ -144,5 +141,4 @@ err_plat_reg2: | |||
144 | kfree(samsung_bl_data); | 141 | kfree(samsung_bl_data); |
145 | err_data: | 142 | err_data: |
146 | kfree(samsung_bl_device); | 143 | kfree(samsung_bl_device); |
147 | return; | ||
148 | } | 144 | } |
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index daf3db9f0058..e9de9e92ce01 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c | |||
@@ -238,11 +238,9 @@ struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, | |||
238 | if (!pdev) | 238 | if (!pdev) |
239 | return ERR_PTR(-EINVAL); | 239 | return ERR_PTR(-EINVAL); |
240 | 240 | ||
241 | client = kzalloc(sizeof(struct s3c_adc_client), GFP_KERNEL); | 241 | client = kzalloc(sizeof(*client), GFP_KERNEL); |
242 | if (!client) { | 242 | if (!client) |
243 | dev_err(&pdev->dev, "no memory for adc client\n"); | ||
244 | return ERR_PTR(-ENOMEM); | 243 | return ERR_PTR(-ENOMEM); |
245 | } | ||
246 | 244 | ||
247 | client->pdev = pdev; | 245 | client->pdev = pdev; |
248 | client->is_ts = is_ts; | 246 | client->is_ts = is_ts; |
@@ -344,11 +342,9 @@ static int s3c_adc_probe(struct platform_device *pdev) | |||
344 | int ret; | 342 | int ret; |
345 | unsigned tmp; | 343 | unsigned tmp; |
346 | 344 | ||
347 | adc = devm_kzalloc(dev, sizeof(struct adc_device), GFP_KERNEL); | 345 | adc = devm_kzalloc(dev, sizeof(*adc), GFP_KERNEL); |
348 | if (adc == NULL) { | 346 | if (!adc) |
349 | dev_err(dev, "failed to allocate adc_device\n"); | ||
350 | return -ENOMEM; | 347 | return -ENOMEM; |
351 | } | ||
352 | 348 | ||
353 | spin_lock_init(&adc->lock); | 349 | spin_lock_init(&adc->lock); |
354 | 350 | ||
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index dc269d9143bc..5668e4eb03df 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c | |||
@@ -339,8 +339,7 @@ void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd) | |||
339 | pd->bus_num = 0; | 339 | pd->bus_num = 0; |
340 | } | 340 | } |
341 | 341 | ||
342 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 342 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c0); |
343 | &s3c_device_i2c0); | ||
344 | 343 | ||
345 | if (!npd->cfg_gpio) | 344 | if (!npd->cfg_gpio) |
346 | npd->cfg_gpio = s3c_i2c0_cfg_gpio; | 345 | npd->cfg_gpio = s3c_i2c0_cfg_gpio; |
@@ -368,8 +367,7 @@ void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd) | |||
368 | pd->bus_num = 1; | 367 | pd->bus_num = 1; |
369 | } | 368 | } |
370 | 369 | ||
371 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 370 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c1); |
372 | &s3c_device_i2c1); | ||
373 | 371 | ||
374 | if (!npd->cfg_gpio) | 372 | if (!npd->cfg_gpio) |
375 | npd->cfg_gpio = s3c_i2c1_cfg_gpio; | 373 | npd->cfg_gpio = s3c_i2c1_cfg_gpio; |
@@ -398,8 +396,7 @@ void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd) | |||
398 | pd->bus_num = 2; | 396 | pd->bus_num = 2; |
399 | } | 397 | } |
400 | 398 | ||
401 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 399 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c2); |
402 | &s3c_device_i2c2); | ||
403 | 400 | ||
404 | if (!npd->cfg_gpio) | 401 | if (!npd->cfg_gpio) |
405 | npd->cfg_gpio = s3c_i2c2_cfg_gpio; | 402 | npd->cfg_gpio = s3c_i2c2_cfg_gpio; |
@@ -428,8 +425,7 @@ void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd) | |||
428 | pd->bus_num = 3; | 425 | pd->bus_num = 3; |
429 | } | 426 | } |
430 | 427 | ||
431 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 428 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c3); |
432 | &s3c_device_i2c3); | ||
433 | 429 | ||
434 | if (!npd->cfg_gpio) | 430 | if (!npd->cfg_gpio) |
435 | npd->cfg_gpio = s3c_i2c3_cfg_gpio; | 431 | npd->cfg_gpio = s3c_i2c3_cfg_gpio; |
@@ -458,8 +454,7 @@ void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd) | |||
458 | pd->bus_num = 4; | 454 | pd->bus_num = 4; |
459 | } | 455 | } |
460 | 456 | ||
461 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 457 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c4); |
462 | &s3c_device_i2c4); | ||
463 | 458 | ||
464 | if (!npd->cfg_gpio) | 459 | if (!npd->cfg_gpio) |
465 | npd->cfg_gpio = s3c_i2c4_cfg_gpio; | 460 | npd->cfg_gpio = s3c_i2c4_cfg_gpio; |
@@ -488,8 +483,7 @@ void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd) | |||
488 | pd->bus_num = 5; | 483 | pd->bus_num = 5; |
489 | } | 484 | } |
490 | 485 | ||
491 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 486 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c5); |
492 | &s3c_device_i2c5); | ||
493 | 487 | ||
494 | if (!npd->cfg_gpio) | 488 | if (!npd->cfg_gpio) |
495 | npd->cfg_gpio = s3c_i2c5_cfg_gpio; | 489 | npd->cfg_gpio = s3c_i2c5_cfg_gpio; |
@@ -518,8 +512,7 @@ void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd) | |||
518 | pd->bus_num = 6; | 512 | pd->bus_num = 6; |
519 | } | 513 | } |
520 | 514 | ||
521 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 515 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c6); |
522 | &s3c_device_i2c6); | ||
523 | 516 | ||
524 | if (!npd->cfg_gpio) | 517 | if (!npd->cfg_gpio) |
525 | npd->cfg_gpio = s3c_i2c6_cfg_gpio; | 518 | npd->cfg_gpio = s3c_i2c6_cfg_gpio; |
@@ -548,8 +541,7 @@ void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd) | |||
548 | pd->bus_num = 7; | 541 | pd->bus_num = 7; |
549 | } | 542 | } |
550 | 543 | ||
551 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 544 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c7); |
552 | &s3c_device_i2c7); | ||
553 | 545 | ||
554 | if (!npd->cfg_gpio) | 546 | if (!npd->cfg_gpio) |
555 | npd->cfg_gpio = s3c_i2c7_cfg_gpio; | 547 | npd->cfg_gpio = s3c_i2c7_cfg_gpio; |
@@ -615,8 +607,7 @@ void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd) | |||
615 | { | 607 | { |
616 | struct samsung_keypad_platdata *npd; | 608 | struct samsung_keypad_platdata *npd; |
617 | 609 | ||
618 | npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata), | 610 | npd = s3c_set_platdata(pd, sizeof(*npd), &samsung_device_keypad); |
619 | &samsung_device_keypad); | ||
620 | 611 | ||
621 | if (!npd->cfg_gpio) | 612 | if (!npd->cfg_gpio) |
622 | npd->cfg_gpio = samsung_keypad_cfg_gpio; | 613 | npd->cfg_gpio = samsung_keypad_cfg_gpio; |
@@ -721,8 +712,7 @@ void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand) | |||
721 | * time then there is little chance the system is going to run. | 712 | * time then there is little chance the system is going to run. |
722 | */ | 713 | */ |
723 | 714 | ||
724 | npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand), | 715 | npd = s3c_set_platdata(nand, sizeof(*npd), &s3c_device_nand); |
725 | &s3c_device_nand); | ||
726 | if (!npd) | 716 | if (!npd) |
727 | return; | 717 | return; |
728 | 718 | ||
@@ -1022,8 +1012,7 @@ void __init dwc2_hsotg_set_platdata(struct dwc2_hsotg_plat *pd) | |||
1022 | { | 1012 | { |
1023 | struct dwc2_hsotg_plat *npd; | 1013 | struct dwc2_hsotg_plat *npd; |
1024 | 1014 | ||
1025 | npd = s3c_set_platdata(pd, sizeof(struct dwc2_hsotg_plat), | 1015 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_usb_hsotg); |
1026 | &s3c_device_usb_hsotg); | ||
1027 | 1016 | ||
1028 | if (!npd->phy_init) | 1017 | if (!npd->phy_init) |
1029 | npd->phy_init = s5p_usb_phy_init; | 1018 | npd->phy_init = s5p_usb_phy_init; |
diff --git a/arch/arm/plat-samsung/platformdata.c b/arch/arm/plat-samsung/platformdata.c index b430e9946287..6cf52ee7eeec 100644 --- a/arch/arm/plat-samsung/platformdata.c +++ b/arch/arm/plat-samsung/platformdata.c | |||
@@ -29,10 +29,8 @@ void __init *s3c_set_platdata(void *pd, size_t pdsize, | |||
29 | } | 29 | } |
30 | 30 | ||
31 | npd = kmemdup(pd, pdsize, GFP_KERNEL); | 31 | npd = kmemdup(pd, pdsize, GFP_KERNEL); |
32 | if (!npd) { | 32 | if (!npd) |
33 | printk(KERN_ERR "%s: cannot clone platform data\n", pdev->name); | ||
34 | return NULL; | 33 | return NULL; |
35 | } | ||
36 | 34 | ||
37 | pdev->dev.platform_data = npd; | 35 | pdev->dev.platform_data = npd; |
38 | return npd; | 36 | return npd; |