aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/dev-i2c0.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-samsung/dev-i2c0.c')
-rw-r--r--arch/arm/plat-samsung/dev-i2c0.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/arm/plat-samsung/dev-i2c0.c b/arch/arm/plat-samsung/dev-i2c0.c
index 3a601c16f03c..f8251f5098bd 100644
--- a/arch/arm/plat-samsung/dev-i2c0.c
+++ b/arch/arm/plat-samsung/dev-i2c0.c
@@ -48,7 +48,7 @@ struct platform_device s3c_device_i2c0 = {
48 .resource = s3c_i2c_resource, 48 .resource = s3c_i2c_resource,
49}; 49};
50 50
51static struct s3c2410_platform_i2c default_i2c_data0 __initdata = { 51struct s3c2410_platform_i2c default_i2c_data __initdata = {
52 .flags = 0, 52 .flags = 0,
53 .slave_addr = 0x10, 53 .slave_addr = 0x10,
54 .frequency = 100*1000, 54 .frequency = 100*1000,
@@ -60,13 +60,11 @@ void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
60 struct s3c2410_platform_i2c *npd; 60 struct s3c2410_platform_i2c *npd;
61 61
62 if (!pd) 62 if (!pd)
63 pd = &default_i2c_data0; 63 pd = &default_i2c_data;
64 64
65 npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL); 65 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
66 if (!npd) 66 &s3c_device_i2c0);
67 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
68 else if (!npd->cfg_gpio)
69 npd->cfg_gpio = s3c_i2c0_cfg_gpio;
70 67
71 s3c_device_i2c0.dev.platform_data = npd; 68 if (!npd->cfg_gpio)
69 npd->cfg_gpio = s3c_i2c0_cfg_gpio;
72} 70}