aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-pxa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-pxa.c')
-rw-r--r--drivers/i2c/busses/i2c-pxa.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 67ccbea24ba4..70f7ab829d36 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -936,10 +936,10 @@ static struct pxa_i2c i2c_pxa = {
936 }, 936 },
937}; 937};
938 938
939static int i2c_pxa_probe(struct device *dev) 939static int i2c_pxa_probe(struct platform_device *dev)
940{ 940{
941 struct pxa_i2c *i2c = &i2c_pxa; 941 struct pxa_i2c *i2c = &i2c_pxa;
942 struct i2c_pxa_platform_data *plat = dev->platform_data; 942 struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
943 int ret; 943 int ret;
944 944
945#ifdef CONFIG_PXA27x 945#ifdef CONFIG_PXA27x
@@ -968,7 +968,7 @@ static int i2c_pxa_probe(struct device *dev)
968 i2c_pxa_reset(i2c); 968 i2c_pxa_reset(i2c);
969 969
970 i2c->adap.algo_data = i2c; 970 i2c->adap.algo_data = i2c;
971 i2c->adap.dev.parent = dev; 971 i2c->adap.dev.parent = &dev->dev;
972 972
973 ret = i2c_add_adapter(&i2c->adap); 973 ret = i2c_add_adapter(&i2c->adap);
974 if (ret < 0) { 974 if (ret < 0) {
@@ -976,7 +976,7 @@ static int i2c_pxa_probe(struct device *dev)
976 goto err_irq; 976 goto err_irq;
977 } 977 }
978 978
979 dev_set_drvdata(dev, i2c); 979 platform_set_drvdata(dev, i2c);
980 980
981#ifdef CONFIG_I2C_PXA_SLAVE 981#ifdef CONFIG_I2C_PXA_SLAVE
982 printk(KERN_INFO "I2C: %s: PXA I2C adapter, slave address %d\n", 982 printk(KERN_INFO "I2C: %s: PXA I2C adapter, slave address %d\n",
@@ -993,11 +993,11 @@ static int i2c_pxa_probe(struct device *dev)
993 return ret; 993 return ret;
994} 994}
995 995
996static int i2c_pxa_remove(struct device *dev) 996static int i2c_pxa_remove(struct platform_device *dev)
997{ 997{
998 struct pxa_i2c *i2c = dev_get_drvdata(dev); 998 struct pxa_i2c *i2c = platform_get_drvdata(dev);
999 999
1000 dev_set_drvdata(dev, NULL); 1000 platform_set_drvdata(dev, NULL);
1001 1001
1002 i2c_del_adapter(&i2c->adap); 1002 i2c_del_adapter(&i2c->adap);
1003 free_irq(IRQ_I2C, i2c); 1003 free_irq(IRQ_I2C, i2c);
@@ -1006,21 +1006,22 @@ static int i2c_pxa_remove(struct device *dev)
1006 return 0; 1006 return 0;
1007} 1007}
1008 1008
1009static struct device_driver i2c_pxa_driver = { 1009static struct platform_driver i2c_pxa_driver = {
1010 .name = "pxa2xx-i2c",
1011 .bus = &platform_bus_type,
1012 .probe = i2c_pxa_probe, 1010 .probe = i2c_pxa_probe,
1013 .remove = i2c_pxa_remove, 1011 .remove = i2c_pxa_remove,
1012 .driver = {
1013 .name = "pxa2xx-i2c",
1014 },
1014}; 1015};
1015 1016
1016static int __init i2c_adap_pxa_init(void) 1017static int __init i2c_adap_pxa_init(void)
1017{ 1018{
1018 return driver_register(&i2c_pxa_driver); 1019 return platform_driver_register(&i2c_pxa_driver);
1019} 1020}
1020 1021
1021static void i2c_adap_pxa_exit(void) 1022static void i2c_adap_pxa_exit(void)
1022{ 1023{
1023 return driver_unregister(&i2c_pxa_driver); 1024 return platform_driver_unregister(&i2c_pxa_driver);
1024} 1025}
1025 1026
1026module_init(i2c_adap_pxa_init); 1027module_init(i2c_adap_pxa_init);